comparison API/Factories/Xml/WarFoundryXmlSystemFactoryTest.cs @ 85:052148dc0a2f

Re #99: Define "points" values in GameSystem * Test point string loading (checks shift of default value responsibility from GameSystem to factory) no-open-ticket
author IBBoard <dev@ibboard.co.uk>
date Sun, 20 Feb 2011 20:43:50 +0000
parents 72479ca6feb4
children 7c21ca1482cb
comparison
equal deleted inserted replaced
84:168c5aab34bb 85:052148dc0a2f
65 [Test()] 65 [Test()]
66 public void TestValidCategoriesLoadsCorrectly() 66 public void TestValidCategoriesLoadsCorrectly()
67 { 67 {
68 GameSystem system = SingleXmlObjectLoader.LoadGameSystemFromXML(WarFoundryXmlFactory.GetFactory(), new FileInfo("testdata/xml-system-factory/valid-categories.systemx")); 68 GameSystem system = SingleXmlObjectLoader.LoadGameSystemFromXML(WarFoundryXmlFactory.GetFactory(), new FileInfo("testdata/xml-system-factory/valid-categories.systemx"));
69 Assert.That(system.Categories, Has.Length(5)); 69 Assert.That(system.Categories, Has.Length(5));
70 } 70 }
71 71
72 [Test()] 72 [Test()]
73 public void TestDuplicateCategoryIDErrors() 73 public void TestDuplicateCategoryIDErrors()
74 { 74 {
75 TestFileValidationFailure("testdata/xml-system-factory/duplicate-category-ids.systemx"); 75 TestFileValidationFailure("testdata/xml-system-factory/duplicate-category-ids.systemx");
76 }
77
78 [Test()]
79 public void TestLoadingPointsNamesAndAbbreviations()
80 {
81 GameSystem system = SingleXmlObjectLoader.LoadGameSystemFromXML(WarFoundryXmlFactory.GetFactory(), new FileInfo("testdata/points-strings/names.systemx"));
82 Assert.That(system.SystemPtsAbbrevPlural, Is.EqualTo("ptii"));
83 Assert.That(system.SystemPtsAbbrevSingle, Is.EqualTo("ptus"));
84 Assert.That(system.SystemPtsNamePlural, Is.EqualTo("pointii"));
85 Assert.That(system.SystemPtsNameSingle, Is.EqualTo("pointus"));
86 }
87
88 [Test()]
89 public void TestLoadingDefaultPointsNamesAndAbbreviations()
90 {
91 GameSystem system = SingleXmlObjectLoader.LoadGameSystemFromXML(WarFoundryXmlFactory.GetFactory(), new FileInfo("testdata/default.systemx"));
92 Assert.That(system.SystemPtsAbbrevPlural, Is.EqualTo("pts"));
93 Assert.That(system.SystemPtsAbbrevSingle, Is.EqualTo("pt"));
94 Assert.That(system.SystemPtsNamePlural, Is.EqualTo("points"));
95 Assert.That(system.SystemPtsNameSingle, Is.EqualTo("point"));
76 } 96 }
77 97
78 private void TestFileValidationFailure(string filePath) 98 private void TestFileValidationFailure(string filePath)
79 { 99 {
80 FileInfo systemFile = new FileInfo(filePath); 100 FileInfo systemFile = new FileInfo(filePath);