Index: Ringtoets/Revetment/test/Ringtoets.Revetment.IO.Test/Configurations/WaveConditionsCalculationConfigurationReaderTest.cs =================================================================== diff -u -r6949918830314633db5cc8c16bb2188779fffc93 -r3ddd2e86216438a423797aecd4b1f9808df00bcb --- Ringtoets/Revetment/test/Ringtoets.Revetment.IO.Test/Configurations/WaveConditionsCalculationConfigurationReaderTest.cs (.../WaveConditionsCalculationConfigurationReaderTest.cs) (revision 6949918830314633db5cc8c16bb2188779fffc93) +++ Ringtoets/Revetment/test/Ringtoets.Revetment.IO.Test/Configurations/WaveConditionsCalculationConfigurationReaderTest.cs (.../WaveConditionsCalculationConfigurationReaderTest.cs) (revision 3ddd2e86216438a423797aecd4b1f9808df00bcb) @@ -22,6 +22,7 @@ using System.Collections.Generic; using System.IO; using System.Linq; +using System.Xml.Linq; using System.Xml.Schema; using Core.Common.Base.IO; using Core.Common.TestUtil; @@ -36,7 +37,7 @@ public class WaveConditionsCalculationConfigurationReaderTest { private readonly string testDirectoryPath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Revetment.IO, - nameof(WaveConditionsCalculationConfigurationReader)); + nameof(WaveConditionsCalculationConfigurationReader)); private static IEnumerable InvalidConfigurations { @@ -160,7 +161,7 @@ string filePath = Path.Combine(testDirectoryPath, "validConfigurationEmptyCalculation.xml"); // Call - var reader = new WaveConditionsCalculationConfigurationReader(filePath); + var reader = new TestWaveConditionsCalculationConfigurationReader(filePath); // Assert Assert.IsInstanceOf>(reader); @@ -174,7 +175,7 @@ string filePath = Path.Combine(testDirectoryPath, fileName); // Call - TestDelegate call = () => new WaveConditionsCalculationConfigurationReader(filePath); + TestDelegate call = () => new TestWaveConditionsCalculationConfigurationReader(filePath); // Assert var exception = Assert.Throws(call); @@ -187,7 +188,7 @@ { // Setup string filePath = Path.Combine(testDirectoryPath, "validConfigurationEmptyCalculation.xml"); - var reader = new WaveConditionsCalculationConfigurationReader(filePath); + var reader = new TestWaveConditionsCalculationConfigurationReader(filePath); // Call IEnumerable readItems = reader.Read().ToArray(); @@ -196,7 +197,6 @@ var calculation = (WaveConditionsCalculationConfiguration) readItems.Single(); Assert.IsNotNull(calculation); - Assert.AreEqual("Berekening 1", calculation.Name); Assert.IsNull(calculation.HydraulicBoundaryLocationName); Assert.IsNull(calculation.UpperBoundaryRevetment); Assert.IsNull(calculation.LowerBoundaryRevetment); @@ -213,7 +213,7 @@ { // Setup string filePath = Path.Combine(testDirectoryPath, "validConfigurationCalculationContainingEmptyWaveReduction.xml"); - var reader = new WaveConditionsCalculationConfigurationReader(filePath); + var reader = new TestWaveConditionsCalculationConfigurationReader(filePath); // Call IEnumerable readItems = reader.Read().ToArray(); @@ -233,7 +233,7 @@ { // Setup string filePath = Path.Combine(testDirectoryPath, "validConfigurationCalculationContainingNaNs.xml"); - var reader = new WaveConditionsCalculationConfigurationReader(filePath); + var reader = new TestWaveConditionsCalculationConfigurationReader(filePath); // Call IEnumerable readItems = reader.Read().ToArray(); @@ -255,7 +255,7 @@ { // Setup string filePath = Path.Combine(testDirectoryPath, "validConfigurationCalculationContaininInfinities.xml"); - var reader = new WaveConditionsCalculationConfigurationReader(filePath); + var reader = new TestWaveConditionsCalculationConfigurationReader(filePath); // Call IEnumerable readItems = reader.Read().ToArray(); @@ -287,7 +287,7 @@ { // Setup string filePath = Path.Combine(testDirectoryPath, fileName); - var reader = new WaveConditionsCalculationConfigurationReader(filePath); + var reader = new TestWaveConditionsCalculationConfigurationReader(filePath); // Call IEnumerable readItems = reader.Read().ToArray(); @@ -296,7 +296,6 @@ var calculation = (WaveConditionsCalculationConfiguration) readItems.Single(); Assert.IsNotNull(calculation); - Assert.AreEqual("Berekening 1", calculation.Name); Assert.AreEqual("HRlocatie", calculation.HydraulicBoundaryLocationName); Assert.AreEqual(1.1, calculation.UpperBoundaryRevetment); Assert.AreEqual(2.2, calculation.LowerBoundaryRevetment); @@ -316,7 +315,7 @@ { // Setup string filePath = Path.Combine(testDirectoryPath, "validConfigurationPartialCalculation.xml"); - var reader = new WaveConditionsCalculationConfigurationReader(filePath); + var reader = new TestWaveConditionsCalculationConfigurationReader(filePath); // Call IEnumerable readItems = reader.Read().ToArray(); @@ -325,7 +324,6 @@ var calculation = (WaveConditionsCalculationConfiguration) readItems.Single(); Assert.IsNotNull(calculation); - Assert.AreEqual("Berekening 1", calculation.Name); Assert.IsNull(calculation.HydraulicBoundaryLocationName); Assert.AreEqual(1.1, calculation.UpperBoundaryRevetment); Assert.AreEqual(2.2, calculation.LowerBoundaryRevetment); @@ -339,5 +337,16 @@ Assert.AreEqual(3.3, calculation.WaveReduction.BreakWaterHeight); Assert.IsNull(calculation.WaveReduction.UseForeshoreProfile); } + + private class TestWaveConditionsCalculationConfigurationReader : WaveConditionsCalculationConfigurationReader + { + public TestWaveConditionsCalculationConfigurationReader(string xmlFilePath) : base(xmlFilePath) {} + protected override WaveConditionsCalculationConfiguration ParseCalculationElement(XElement calculationElement) + { + var configuration = new WaveConditionsCalculationConfiguration("test"); + ParseCalculationElementData(calculationElement, configuration); + return configuration; + } + } } } \ No newline at end of file