Fixes default initializer of Skill model.

Adds tests for Skill model.
This commit is contained in:
2020-09-05 23:25:40 -07:00
parent c3031fbc39
commit 555ba4c007
3 changed files with 122 additions and 1 deletions

View File

@@ -10,6 +10,16 @@
@implementation Skill
-(id)init {
self = [super init];
self.name = @"";
self.abilityScoreName = @"";
self.notes = @"";
return self;
}
-(id)initWithName: (NSString*)name abilityScoreName:(NSString*)abilityScoreName andNotes:(NSString*)notes{
self = [super init];
@@ -33,7 +43,8 @@
-(NSString*)textForMonster: (Monster*)monster {
int bonus = [self skillBonusForMonster:monster];
return [NSString stringWithFormat:@"%@%@ %d", [self.name substringToIndex:1], [self.name substringFromIndex:1], bonus];
// [self.name localizedUppercaseString]
return [NSString stringWithFormat:@"%@%@ %d", [[self.name substringToIndex:1] localizedUppercaseString], [self.name substringFromIndex:1], bonus];
}
@end