Index: trunk/src/GeoTechnics/Tests/WaternetCreator/LocationTest.cs
===================================================================
diff -u -r7 -r15
--- trunk/src/GeoTechnics/Tests/WaternetCreator/LocationTest.cs (.../LocationTest.cs) (revision 7)
+++ trunk/src/GeoTechnics/Tests/WaternetCreator/LocationTest.cs (.../LocationTest.cs) (revision 15)
@@ -15,100 +15,8 @@
[TestFixture]
public class LocationTest
{
- ///
- /// Loads the saved file that was created in revision 17400.
- ///
- ///
- [Test]
- public void BackwardsCompatibility_LoadFromRevision17400_LoadAllExpectedData()
- {
- // setup
- var filePath = Path.Combine(TestHelper.GetDataPath(), "BackwardsCompatibility", "SavedClassWithLocationAsChildR17400.xml");
- Assert.IsTrue(File.Exists(filePath), String.Format(
- "Expected file '{0}' to exist. " +
- "Missing file can be regenerated with BackwardsCompatibility_SaveUsingRevision17400_CreateFile. " +
- "Please read instructions before doing so.", filePath));
- var xmlDeserializer = new XmlDeserializer();
- // call
- using (var persistedClass = (ClassWithLocationAsChild) xmlDeserializer.XmlDeserialize(filePath, typeof(ClassWithLocationAsChild)))
- {
- // assert
- Assert.IsNotNull(persistedClass);
- Assert.IsNotNull(persistedClass.Location);
-
- var location = persistedClass.Location;
- Assert.IsFalse(location.AdjustPl3And4ForUplift);
- Assert.IsTrue(location.WaternetCreationMode == WaternetCreationMode.CreateWaternet);
- Assert.AreEqual(DikeSoilScenario.SandDikeOnClay, location.DikeSoilScenario);
- Assert.AreEqual(7.7, location.HeadInPLLine2Inwards);
- Assert.AreEqual(8.8, location.HeadInPLLine2Outwards);
- Assert.AreEqual(28.28, location.HeadInPLLine3, "Expected 28.28 due to setting Location.WaterLevelRiver should set Location.HeadInPLLine3 to same value.");
- Assert.AreEqual(28.28, location.HeadInPLLine4, "Expected 28.28 due to setting Location.WaterLevelRiver should set Location.HeadInPLLine4 to same value.");
- Assert.AreEqual(17.17, location.LeakageLengthInwardsPl3);
- Assert.AreEqual(18.18, location.LeakageLengthInwardsPl4);
- Assert.AreEqual(19.19, location.LeakageLengthOutwardsPl3);
- Assert.AreEqual(20.20, location.LeakageLengthOutwardsPl4);
- Assert.IsNotNull(location.LocalXzpl1Line);
- Assert.AreEqual("test pl 1 line", location.LocalXzpl1Line.Name);
- Assert.AreEqual(PhreaticAdaptionType.MakeEmpty, location.NWOPhreaticAdaption);
- Assert.AreEqual(21.21, location.PenetrationLength);
- Assert.AreEqual(PlLineCreationMethod.DupuitDynamic, location.PlLineCreationMethod);
- Assert.AreEqual(22.22, location.PlLineOffsetBelowDikeToeAtPolder);
- Assert.AreEqual(23.23, location.PlLineOffsetBelowDikeTopAtPolder);
- Assert.AreEqual(24.24, location.PlLineOffsetBelowDikeTopAtRiver);
- Assert.AreEqual(25.25, location.PlLineOffsetBelowShoulderBaseInside);
- Assert.AreEqual(26.26, location.SlopeDampingPiezometricHeightPolderSide);
- Assert.IsNotNull(location.SoilProfile1D);
- Assert.AreEqual("test profile 1D", location.SoilProfile1D.Name);
- Assert.IsNotNull(location.SoilProfile2D);
- Assert.AreEqual("test profile 2D", location.SoilProfile2D.Name);
- Assert.IsNull(location.Surfaceline, "Expected Null due to XmlIgnore");
- Assert.AreEqual(27.27, location.WaterLevelPolder);
- Assert.AreEqual(28.28, location.WaterLevelRiver);
- Assert.AreEqual(29.29, location.WaterLevelRiverAverage);
- Assert.AreEqual(30.30, location.WaterLevelRiverLow);
- Assert.AreEqual(31.31, location.X);
- Assert.AreEqual(34.34, location.Y);
- }
- }
-
[Test]
- [Explicit("Only run this test in using revision 17400.")]
- public void BackwardsCompatibility_SaveUsingRevision17399_CreateFile()
- {
- // This test generates a file, that is generated prior to refactoring of Location.
- // The refactoring must not have impact on the backwards compatibility of the Location class.
- // As such, future revision should always be able to ClassWithLocationAsChild and properly persist
- // the Location member.
- // Generate this file only from revision 17400
-
- // setup
- var filePath = Path.Combine(TestHelper.GetDataPath(), "BackwardsCompatibility", "SavedClassWithLocationAsChildR17400.xml");
- if (File.Exists(filePath))
- {
- File.Delete(filePath);
- }
-
- using (var classWithLocationAsChild = new ClassWithLocationAsChild
- {
- Location = new Location()
- })
- {
- using (var serializer = new XmlSerializer())
- {
- SetLocationProperties(classWithLocationAsChild);
-
- // call
- serializer.Serialize(classWithLocationAsChild, filePath);
- }
- }
-
- // assert
- Assert.IsTrue(File.Exists(filePath));
- }
-
- [Test]
public void TestValidateWaterLevelRiver()
{
var location = new Location