Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/PropertyClasses/MacroStabilityInwardsWaterStressLinesPropertiesTest.cs =================================================================== diff -u -ra02ae0363bde2c207d5da1b75edb68a9b4303869 -r332dfb8a2015b4c58f707fe24caae3195fab673b --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/PropertyClasses/MacroStabilityInwardsWaterStressLinesPropertiesTest.cs (.../MacroStabilityInwardsWaterStressLinesPropertiesTest.cs) (revision a02ae0363bde2c207d5da1b75edb68a9b4303869) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/PropertyClasses/MacroStabilityInwardsWaterStressLinesPropertiesTest.cs (.../MacroStabilityInwardsWaterStressLinesPropertiesTest.cs) (revision 332dfb8a2015b4c58f707fe24caae3195fab673b) @@ -21,25 +21,22 @@ using System; using System.ComponentModel; -using System.Linq; -using Core.Common.Gui.Converters; using Core.Common.Gui.PropertyBag; using Core.Common.TestUtil; using NUnit.Framework; +using Ringtoets.MacroStabilityInwards.Data; using Ringtoets.MacroStabilityInwards.Forms.PropertyClasses; -using Ringtoets.MacroStabilityInwards.Primitives; -using Ringtoets.MacroStabilityInwards.Primitives.TestUtil; namespace Ringtoets.MacroStabilityInwards.Forms.Test.PropertyClasses { [TestFixture] - public class MacroStabilityInwardsWaternetPropertiesTest + public class MacroStabilityInwardsWaterStressLinesPropertiesTest { [Test] public void Constructor_DataNull_ThrowsArgumentNullException() { // Call - TestDelegate test = () => new MacroStabilityInwardsWaternetProperties(null); + TestDelegate test = () => new MacroStabilityInwardsWaterStressLinesProperties(null); // Assert var exception = Assert.Throws(test); @@ -50,51 +47,42 @@ public void Constructor_ValidWaternet_ExpectedValues() { // Setup - var waternet = new MacroStabilityInwardsWaternet(new[] - { - new TestMacroStabilityInwardsPhreaticLine() - }, new[] - { - new TestMacroStabilityInwardsWaternetLine() - }); + var input = new MacroStabilityInwardsInput(new MacroStabilityInwardsInput.ConstructionProperties()); // Call - var properties = new MacroStabilityInwardsWaternetProperties(waternet); + var properties = new MacroStabilityInwardsWaterStressLinesProperties(input); // Assert - Assert.IsInstanceOf>(properties); - TestHelper.AssertTypeConverter( - nameof(MacroStabilityInwardsWaternetProperties.PhreaticLines)); - Assert.AreSame(waternet, properties.Data); + Assert.IsInstanceOf>(properties); + TestHelper.AssertTypeConverter( + nameof(MacroStabilityInwardsWaterStressLinesProperties.WaternetDaily)); + TestHelper.AssertTypeConverter( + nameof(MacroStabilityInwardsWaterStressLinesProperties.WaternetExtreme)); + Assert.AreSame(input, properties.Data); } [Test] public void GetProperties_WithData_ReturnExpectedValues() { // Setup - var waternet = new MacroStabilityInwardsWaternet(new[] - { - new TestMacroStabilityInwardsPhreaticLine() - }, new[] - { - new TestMacroStabilityInwardsWaternetLine() - }); + var input = new MacroStabilityInwardsInput(new MacroStabilityInwardsInput.ConstructionProperties()); // Call - var properties = new MacroStabilityInwardsWaternetProperties(waternet); + var properties = new MacroStabilityInwardsWaterStressLinesProperties(input); // Assert - Assert.AreSame(waternet.PhreaticLines.Single(), properties.PhreaticLines.Single().Data); - Assert.AreSame(waternet.WaternetLines.Single(), properties.WaternetLines.Single().Data); + CollectionAssert.IsEmpty(properties.WaternetExtreme.PhreaticLines); + CollectionAssert.IsEmpty(properties.WaternetExtreme.WaternetLines); + CollectionAssert.IsEmpty(properties.WaternetDaily.PhreaticLines); + CollectionAssert.IsEmpty(properties.WaternetDaily.WaternetLines); } [Test] public void ToString_Always_ReturnEmpty() { // Setup - var waternet = new MacroStabilityInwardsWaternet(Enumerable.Empty(), - Enumerable.Empty()); - var properties = new MacroStabilityInwardsWaternetProperties(waternet); + var input = new MacroStabilityInwardsInput(new MacroStabilityInwardsInput.ConstructionProperties()); + var properties = new MacroStabilityInwardsWaterStressLinesProperties(input); // Call string name = properties.ToString(); @@ -107,11 +95,10 @@ public void Constructor_ValidData_PropertieshaveExpectedAttributeValues() { // Setup - var waternet = new MacroStabilityInwardsWaternet(Enumerable.Empty(), - Enumerable.Empty()); + var input = new MacroStabilityInwardsInput(new MacroStabilityInwardsInput.ConstructionProperties()); // Call - var properties = new MacroStabilityInwardsWaternetProperties(waternet); + var properties = new MacroStabilityInwardsWaterStressLinesProperties(input); // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); @@ -120,18 +107,18 @@ const string waterStressesCategoryName = "Waterspanningen"; - PropertyDescriptor phreaticLinesProperty = dynamicProperties[0]; - PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(phreaticLinesProperty, + PropertyDescriptor waternetExtremeProperty = dynamicProperties[0]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(waternetExtremeProperty, waterStressesCategoryName, - "Stijghoogtelijnen", - "Eigenschappen van de stijghoogtelijnen.", + "Extreme omstandigheden", + "Eigenschappen van de waterspanningslijnen bij extreme omstandigheden.", true); - PropertyDescriptor waternetLinesProperty = dynamicProperties[1]; - PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(waternetLinesProperty, + PropertyDescriptor waternetDailyProperty = dynamicProperties[1]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(waternetDailyProperty, waterStressesCategoryName, - "Zones", - "Eigenschappen van de zones.", + "Dagelijkse omstandigheden", + "Eigenschappen van de waterspanningslijnen bij dagelijkse omstandigheden.", true); } } Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/PropertyClasses/MacroStabilityInwardsWaternetPropertiesTest.cs =================================================================== diff -u -r3d30a9febb6492e54f2082bf0a21a1602717b098 -r332dfb8a2015b4c58f707fe24caae3195fab673b --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/PropertyClasses/MacroStabilityInwardsWaternetPropertiesTest.cs (.../MacroStabilityInwardsWaternetPropertiesTest.cs) (revision 3d30a9febb6492e54f2082bf0a21a1602717b098) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/PropertyClasses/MacroStabilityInwardsWaternetPropertiesTest.cs (.../MacroStabilityInwardsWaternetPropertiesTest.cs) (revision 332dfb8a2015b4c58f707fe24caae3195fab673b) @@ -21,22 +21,25 @@ using System; using System.ComponentModel; +using System.Linq; +using Core.Common.Gui.Converters; using Core.Common.Gui.PropertyBag; using Core.Common.TestUtil; using NUnit.Framework; -using Ringtoets.MacroStabilityInwards.Data; using Ringtoets.MacroStabilityInwards.Forms.PropertyClasses; +using Ringtoets.MacroStabilityInwards.Primitives; +using Ringtoets.MacroStabilityInwards.Primitives.TestUtil; namespace Ringtoets.MacroStabilityInwards.Forms.Test.PropertyClasses { [TestFixture] - public class MacroStabilityInwardsWaterStressLinesPropertiesTest + public class MacroStabilityInwardsWaternetPropertiesTest { [Test] public void Constructor_DataNull_ThrowsArgumentNullException() { // Call - TestDelegate test = () => new MacroStabilityInwardsWaterStressLinesProperties(null); + TestDelegate test = () => new MacroStabilityInwardsWaternetProperties(null); // Assert var exception = Assert.Throws(test); @@ -47,42 +50,51 @@ public void Constructor_ValidWaternet_ExpectedValues() { // Setup - var input = new MacroStabilityInwardsInput(new MacroStabilityInwardsInput.ConstructionProperties()); + var waternet = new MacroStabilityInwardsWaternet(new[] + { + new TestMacroStabilityInwardsPhreaticLine() + }, new[] + { + new TestMacroStabilityInwardsWaternetLine() + }); // Call - var properties = new MacroStabilityInwardsWaterStressLinesProperties(input); + var properties = new MacroStabilityInwardsWaternetProperties(waternet); // Assert - Assert.IsInstanceOf>(properties); - TestHelper.AssertTypeConverter( - nameof(MacroStabilityInwardsWaterStressLinesProperties.WaternetDaily)); - TestHelper.AssertTypeConverter( - nameof(MacroStabilityInwardsWaterStressLinesProperties.WaternetExtreme)); - Assert.AreSame(input, properties.Data); + Assert.IsInstanceOf>(properties); + TestHelper.AssertTypeConverter( + nameof(MacroStabilityInwardsWaternetProperties.PhreaticLines)); + Assert.AreSame(waternet, properties.Data); } [Test] public void GetProperties_WithData_ReturnExpectedValues() { // Setup - var input = new MacroStabilityInwardsInput(new MacroStabilityInwardsInput.ConstructionProperties()); + var waternet = new MacroStabilityInwardsWaternet(new[] + { + new TestMacroStabilityInwardsPhreaticLine() + }, new[] + { + new TestMacroStabilityInwardsWaternetLine() + }); // Call - var properties = new MacroStabilityInwardsWaterStressLinesProperties(input); + var properties = new MacroStabilityInwardsWaternetProperties(waternet); // Assert - CollectionAssert.IsEmpty(properties.WaternetExtreme.PhreaticLines); - CollectionAssert.IsEmpty(properties.WaternetExtreme.WaternetLines); - CollectionAssert.IsEmpty(properties.WaternetDaily.PhreaticLines); - CollectionAssert.IsEmpty(properties.WaternetDaily.WaternetLines); + Assert.AreSame(waternet.PhreaticLines.Single(), properties.PhreaticLines.Single().Data); + Assert.AreSame(waternet.WaternetLines.Single(), properties.WaternetLines.Single().Data); } [Test] public void ToString_Always_ReturnEmpty() { // Setup - var input = new MacroStabilityInwardsInput(new MacroStabilityInwardsInput.ConstructionProperties()); - var properties = new MacroStabilityInwardsWaterStressLinesProperties(input); + var waternet = new MacroStabilityInwardsWaternet(Enumerable.Empty(), + Enumerable.Empty()); + var properties = new MacroStabilityInwardsWaternetProperties(waternet); // Call string name = properties.ToString(); @@ -95,10 +107,11 @@ public void Constructor_ValidData_PropertieshaveExpectedAttributeValues() { // Setup - var input = new MacroStabilityInwardsInput(new MacroStabilityInwardsInput.ConstructionProperties()); + var waternet = new MacroStabilityInwardsWaternet(Enumerable.Empty(), + Enumerable.Empty()); // Call - var properties = new MacroStabilityInwardsWaterStressLinesProperties(input); + var properties = new MacroStabilityInwardsWaternetProperties(waternet); // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); @@ -107,18 +120,18 @@ const string waterStressesCategoryName = "Waterspanningen"; - PropertyDescriptor waternetExtremeProperty = dynamicProperties[0]; - PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(waternetExtremeProperty, + PropertyDescriptor phreaticLinesProperty = dynamicProperties[0]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(phreaticLinesProperty, waterStressesCategoryName, - "Extreme omstandigheden", - "Eigenschappen van de waterspanningslijnen bij extreme omstandigheden.", + "Stijghoogtelijnen", + "Eigenschappen van de stijghoogtelijnen.", true); - PropertyDescriptor waternetDailyProperty = dynamicProperties[1]; - PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(waternetDailyProperty, + PropertyDescriptor waternetLinesProperty = dynamicProperties[1]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(waternetLinesProperty, waterStressesCategoryName, - "Dagelijkse omstandigheden", - "Eigenschappen van de waterspanningslijnen bij dagelijkse omstandigheden.", + "Zones", + "Eigenschappen van de zones.", true); } } Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Ringtoets.MacroStabilityInwards.Forms.Test.csproj =================================================================== diff -u -r04f5526f955c773d4987e820e2aca2614dfbd8d8 -r332dfb8a2015b4c58f707fe24caae3195fab673b --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Ringtoets.MacroStabilityInwards.Forms.Test.csproj (.../Ringtoets.MacroStabilityInwards.Forms.Test.csproj) (revision 04f5526f955c773d4987e820e2aca2614dfbd8d8) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Ringtoets.MacroStabilityInwards.Forms.Test.csproj (.../Ringtoets.MacroStabilityInwards.Forms.Test.csproj) (revision 332dfb8a2015b4c58f707fe24caae3195fab673b) @@ -74,8 +74,8 @@ - +