Mercurial > repos > IBDev-IBBoard.WarFoundry.API.Tests
comparison API/Exporters/XmlSaveTest.cs @ 172:c026c02583ca
* Remove MockArmy.GetMockArmy as it only causes problems in unit tests
* Remove MockArmyCategory as MockArmy change would make it do nothing special
* Close streams as well as files to fix Windows unit test errors
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sat, 24 Sep 2011 11:46:20 +0100 |
parents | 14d0450f295d |
children |
comparison
equal
deleted
inserted
replaced
171:14d0450f295d | 172:c026c02583ca |
---|---|
24 string xslt = "<xsl:stylesheet version=\"1.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\"><xsl:output method=\"xml\" indent=\"no\" omit-xml-declaration=\"yes\"/><xsl:template match=\"/\"><testTopLevel><armyName><xsl:value-of select=\"army/name\"/></armyName></testTopLevel></xsl:template></xsl:stylesheet>"; | 24 string xslt = "<xsl:stylesheet version=\"1.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\"><xsl:output method=\"xml\" indent=\"no\" omit-xml-declaration=\"yes\"/><xsl:template match=\"/\"><testTopLevel><armyName><xsl:value-of select=\"army/name\"/></armyName></testTopLevel></xsl:template></xsl:stylesheet>"; |
25 string goldOutput = "<testTopLevel><armyName>Mock Army</armyName></testTopLevel>"; | 25 string goldOutput = "<testTopLevel><armyName>Mock Army</armyName></testTopLevel>"; |
26 [TestFixtureSetUp()] | 26 [TestFixtureSetUp()] |
27 public void XmlTestSetup() | 27 public void XmlTestSetup() |
28 { | 28 { |
29 mockArmy = MockArmy.GetMockArmy(); | 29 mockArmy = new MockArmy(); |
30 UnitEquipmentItem equip = new MockNumericAmountUnitEquipmentItem(5); | 30 UnitEquipmentItem equip = new MockNumericAmountUnitEquipmentItem(5); |
31 UnitType unitType = equip.EquipmentForUnit; | 31 UnitType unitType = equip.EquipmentForUnit; |
32 Unit unit = new Unit("unit", "Test Unit", 10, unitType, new MockArmyCategory(unitType.MainCategory)); | 32 Unit unit = new Unit("unit", "Test Unit", 10, unitType, new ArmyCategory(mockArmy, unitType.MainCategory)); |
33 mockArmy.AddUnit(unit); | 33 mockArmy.AddUnit(unit); |
34 | 34 |
35 WarFoundryXmlWithXslExporter.GetDefault().ExportArmy(mockArmy, outputFile); | 35 WarFoundryXmlWithXslExporter.GetDefault().ExportArmy(mockArmy, outputFile); |
36 } | 36 } |
37 | 37 |