Fixes JSON initializer and tests.

This commit is contained in:
2020-09-26 23:10:24 -07:00
parent 2a9b936d0d
commit f4c981ab36
2 changed files with 18 additions and 18 deletions

View File

@@ -114,12 +114,12 @@ NSString* const kMonsterSizeGargantuan = @"gargantuan";
self.alignment = [JSONHelper readStringFromDictionary:jsonRoot forKey:@"alignment" withDefaultValue:@""]; self.alignment = [JSONHelper readStringFromDictionary:jsonRoot forKey:@"alignment" withDefaultValue:@""];
self.armorType = [JSONHelper readStringFromDictionary:jsonRoot forKey:@"armorName" withDefaultValue:@""]; self.armorType = [JSONHelper readStringFromDictionary:jsonRoot forKey:@"armorName" withDefaultValue:@""];
self.otherArmorDescription = [JSONHelper readStringFromDictionary:jsonRoot forKey:@"otherArmorDesc" withDefaultValue:@""]; self.otherArmorDescription = [JSONHelper readStringFromDictionary:jsonRoot forKey:@"otherArmorDesc" withDefaultValue:@""];
self.strengthScore = [JSONHelper readIntFromDictionary:jsonRoot forKey:@"strPoints" withDefaultValue:0]; self.strengthScore = [JSONHelper readIntFromDictionary:jsonRoot forKey:@"strPoints" withDefaultValue:10];
self.dexterityScore = [JSONHelper readIntFromDictionary:jsonRoot forKey:@"dexPoints" withDefaultValue:0]; self.dexterityScore = [JSONHelper readIntFromDictionary:jsonRoot forKey:@"dexPoints" withDefaultValue:10];
self.constitutionScore = [JSONHelper readIntFromDictionary:jsonRoot forKey:@"conPoints" withDefaultValue:0]; self.constitutionScore = [JSONHelper readIntFromDictionary:jsonRoot forKey:@"conPoints" withDefaultValue:10];
self.intelligenceScore = [JSONHelper readIntFromDictionary:jsonRoot forKey:@"intPoints" withDefaultValue:0]; self.intelligenceScore = [JSONHelper readIntFromDictionary:jsonRoot forKey:@"intPoints" withDefaultValue:10];
self.wisdomScore = [JSONHelper readIntFromDictionary:jsonRoot forKey:@"wisPoints" withDefaultValue:0]; self.wisdomScore = [JSONHelper readIntFromDictionary:jsonRoot forKey:@"wisPoints" withDefaultValue:10];
self.charismaScore = [JSONHelper readIntFromDictionary:jsonRoot forKey:@"chaPoints" withDefaultValue:0]; self.charismaScore = [JSONHelper readIntFromDictionary:jsonRoot forKey:@"chaPoints" withDefaultValue:10];
self.shieldBonus = [JSONHelper readIntFromDictionary:jsonRoot forKey:@"shieldBonus" withDefaultValue:0]; self.shieldBonus = [JSONHelper readIntFromDictionary:jsonRoot forKey:@"shieldBonus" withDefaultValue:0];
self.hitDice = [JSONHelper readIntFromDictionary:jsonRoot forKey:@"hitDice" withDefaultValue:0]; self.hitDice = [JSONHelper readIntFromDictionary:jsonRoot forKey:@"hitDice" withDefaultValue:0];

View File

@@ -40,12 +40,12 @@
XCTAssertEqualObjects(@"", _monster.type); XCTAssertEqualObjects(@"", _monster.type);
XCTAssertEqualObjects(@"", _monster.subtype); XCTAssertEqualObjects(@"", _monster.subtype);
XCTAssertEqualObjects(@"", _monster.alignment); XCTAssertEqualObjects(@"", _monster.alignment);
XCTAssertEqual(0, _monster.strengthScore); XCTAssertEqual(10, _monster.strengthScore);
XCTAssertEqual(0, _monster.dexterityScore); XCTAssertEqual(10, _monster.dexterityScore);
XCTAssertEqual(0, _monster.constitutionScore); XCTAssertEqual(10, _monster.constitutionScore);
XCTAssertEqual(0, _monster.intelligenceScore); XCTAssertEqual(10, _monster.intelligenceScore);
XCTAssertEqual(0, _monster.wisdomScore); XCTAssertEqual(10, _monster.wisdomScore);
XCTAssertEqual(0, _monster.charismaScore); XCTAssertEqual(10, _monster.charismaScore);
XCTAssertEqualObjects(@"", _monster.armorType); XCTAssertEqualObjects(@"", _monster.armorType);
XCTAssertEqualObjects(@"", _monster.otherArmorDescription); XCTAssertEqualObjects(@"", _monster.otherArmorDescription);
XCTAssertEqual(0, _monster.shieldBonus); XCTAssertEqual(0, _monster.shieldBonus);
@@ -85,12 +85,12 @@
XCTAssertEqualObjects(@"", _monster.type); XCTAssertEqualObjects(@"", _monster.type);
XCTAssertEqualObjects(@"", _monster.subtype); XCTAssertEqualObjects(@"", _monster.subtype);
XCTAssertEqualObjects(@"", _monster.alignment); XCTAssertEqualObjects(@"", _monster.alignment);
XCTAssertEqual(0, _monster.strengthScore); XCTAssertEqual(10, _monster.strengthScore);
XCTAssertEqual(0, _monster.dexterityScore); XCTAssertEqual(10, _monster.dexterityScore);
XCTAssertEqual(0, _monster.constitutionScore); XCTAssertEqual(10, _monster.constitutionScore);
XCTAssertEqual(0, _monster.intelligenceScore); XCTAssertEqual(10, _monster.intelligenceScore);
XCTAssertEqual(0, _monster.wisdomScore); XCTAssertEqual(10, _monster.wisdomScore);
XCTAssertEqual(0, _monster.charismaScore); XCTAssertEqual(10, _monster.charismaScore);
XCTAssertEqualObjects(@"", _monster.armorType); XCTAssertEqualObjects(@"", _monster.armorType);
XCTAssertEqualObjects(@"", _monster.otherArmorDescription); XCTAssertEqualObjects(@"", _monster.otherArmorDescription);
XCTAssertEqual(0, _monster.shieldBonus); XCTAssertEqual(0, _monster.shieldBonus);