Index: Core/Common/src/Core.Common.Utils/Core.Common.Utils.csproj =================================================================== diff -u -r1795be9025cb0e054dca86a5275203966c0a9b2a -r0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5 --- Core/Common/src/Core.Common.Utils/Core.Common.Utils.csproj (.../Core.Common.Utils.csproj) (revision 1795be9025cb0e054dca86a5275203966c0a9b2a) +++ Core/Common/src/Core.Common.Utils/Core.Common.Utils.csproj (.../Core.Common.Utils.csproj) (revision 0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5) @@ -100,6 +100,7 @@ + Index: Core/Common/src/Core.Common.Utils/EnumDisplayWrapper.cs =================================================================== diff -u -r151bab16a7ebc1bffc0621ab56c6dc219db1e90f -r0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5 --- Core/Common/src/Core.Common.Utils/EnumDisplayWrapper.cs (.../EnumDisplayWrapper.cs) (revision 151bab16a7ebc1bffc0621ab56c6dc219db1e90f) +++ Core/Common/src/Core.Common.Utils/EnumDisplayWrapper.cs (.../EnumDisplayWrapper.cs) (revision 0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5) @@ -68,9 +68,7 @@ private void SetDisplayName(T value) { - var enumField = typeof(T).GetField(Enum.GetName(typeof(T), value)); - var displayName = (ResourcesDisplayNameAttribute) Attribute.GetCustomAttribute(enumField, typeof(ResourcesDisplayNameAttribute)); - DisplayName = displayName == null ? value.ToString() : displayName.DisplayName; + DisplayName = new EnumTypeConverter(typeof(T)).ConvertToString(value) ?? value.ToString(); } } } \ No newline at end of file Index: Core/Common/src/Core.Common.Utils/EnumTypeConverter.cs =================================================================== diff -u --- Core/Common/src/Core.Common.Utils/EnumTypeConverter.cs (revision 0) +++ Core/Common/src/Core.Common.Utils/EnumTypeConverter.cs (revision 0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5) @@ -0,0 +1,72 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.ComponentModel; +using System.Globalization; +using System.Linq; +using System.Reflection; +using Core.Common.Utils.Attributes; + +namespace Core.Common.Utils +{ + /// + /// A type converter to convert Enum objects to and from various other representations. + /// + public class EnumTypeConverter : EnumConverter + { + /// + /// Initializes a new instance of the class for the given Enum . + /// + /// This class is designed such that it looks for on each Enum value. + /// A that represents the type of enumeration to associate with this enumeration converter. + public EnumTypeConverter(Type type) : base(type) {} + + public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) + { + var valueString = value as string; + if (valueString != null) + { + foreach (var fieldInfo in EnumType.GetFields().Where(fieldInfo => valueString == GetDisplayName(fieldInfo))) + { + return Enum.Parse(EnumType, fieldInfo.Name); + } + } + return base.ConvertFrom(context, culture, value); + } + + public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) + { + if (destinationType != typeof(string) || value == null) + { + return base.ConvertTo(context, culture, value, destinationType); + } + var fieldInfo = EnumType.GetField(value.ToString()); + return GetDisplayName(fieldInfo); + } + + private static string GetDisplayName(MemberInfo memberInfo) + { + var resourcesDisplayNameAttribute = (ResourcesDisplayNameAttribute)Attribute.GetCustomAttribute(memberInfo, typeof(ResourcesDisplayNameAttribute)); + return (resourcesDisplayNameAttribute != null) ? resourcesDisplayNameAttribute.DisplayName : null; + } + } +} \ No newline at end of file Index: Core/Common/test/Core.Common.Utils.Test/Core.Common.Utils.Test.csproj =================================================================== diff -u -r3d84064b23186da3fb11f19ff0d07f41e1209bbb -r0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5 --- Core/Common/test/Core.Common.Utils.Test/Core.Common.Utils.Test.csproj (.../Core.Common.Utils.Test.csproj) (revision 3d84064b23186da3fb11f19ff0d07f41e1209bbb) +++ Core/Common/test/Core.Common.Utils.Test/Core.Common.Utils.Test.csproj (.../Core.Common.Utils.Test.csproj) (revision 0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5) @@ -84,6 +84,7 @@ + Index: Core/Common/test/Core.Common.Utils.Test/EnumTypeConverterTest.cs =================================================================== diff -u --- Core/Common/test/Core.Common.Utils.Test/EnumTypeConverterTest.cs (revision 0) +++ Core/Common/test/Core.Common.Utils.Test/EnumTypeConverterTest.cs (revision 0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5) @@ -0,0 +1,219 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.ComponentModel; +using Core.Common.Utils.Attributes; +using Core.Common.Utils.Test.Properties; +using NUnit.Framework; + +namespace Core.Common.Utils.Test +{ + [TestFixture] + public class EnumTypeConverterTest + { + [Test] + public void DefaultConstructor_ExpectedValues() + { + // Call + var converter = new EnumTypeConverter(typeof(object)); + + // Assert + Assert.IsInstanceOf(converter); + } + + [Test] + public void CanConvertTo_DestinationTypeIsInvalid_ReturnsFalse() + { + // Setup + var converter = new EnumTypeConverter(typeof(object)); + + // Call + var canConvert = converter.CanConvertTo(typeof(NotSupportedType)); + + // Assert + Assert.IsFalse(canConvert); + } + + [Test] + public void CanConvertTo_DestinationTypeIsString_ReturnsTrue() + { + // Setup + var converter = new EnumTypeConverter(typeof(object)); + + // Call + var canConvert = converter.CanConvertTo(typeof(string)); + + // Assert + Assert.IsTrue(canConvert); + } + + [Test] + public void ConvertTo_ValueIsOfInvalidType_ThrowsNotSupportedException() + { + // Setup + var notSupportedValue = new NotSupportedType(); + var converter = new EnumTypeConverter(typeof(SimpleEnum)); + + // Call + TestDelegate test = () => converter.ConvertTo(notSupportedValue, typeof(SimpleEnum)); + + // Assert + Assert.Throws(test); + } + + [Test] + public void ConvertTo_ValueIsNull_DoesNotThrowException() + { + // Setup + var converter = new EnumTypeConverter(typeof(SimpleEnum)); + + // Call + object result = new object(); + TestDelegate test = () => result = converter.ConvertTo(null, typeof(string)); + + // Assert + Assert.DoesNotThrow(test); + Assert.AreEqual(string.Empty, result); + } + + [Test] + public void ConvertTo_DestinationTypeIsNull_ThrowsArgumentNullException() + { + // Setup + const SimpleEnum enumValue = SimpleEnum.FirstValue; + var converter = new EnumTypeConverter(typeof(SimpleEnum)); + + // Call + TestDelegate test = () => converter.ConvertTo(enumValue, null); + + // Assert + Assert.Throws(test); + } + + [Test] + public void ConvertTo_DestinationTypeIsInvalid_ThrowsNotSupportedException() + { + // Setup + const SimpleEnum enumValue = SimpleEnum.FirstValue; + var converter = new EnumTypeConverter(typeof(SimpleEnum)); + + // Call + TestDelegate test = () => converter.ConvertTo(enumValue, typeof(NotSupportedType)); + + // Assert + Assert.Throws(test); + } + + [Test] + public void ConvertTo_DestinationTypeIsString_ReturnsExpectedEnumDisplayName() + { + // Setup + const SimpleEnum enumValue = SimpleEnum.FirstValue; + var converter = new EnumTypeConverter(typeof(SimpleEnum)); + + // Call + var result = converter.ConvertTo(enumValue, typeof(string)); + + // Assert + var expectedText = ""; + Assert.AreEqual(expectedText, result); + } + + [Test] + public void CanConvertFrom_SourceTypeIsInvalid_ReturnsFalse() + { + // Setup + var converter = new EnumTypeConverter(typeof(object)); + + // Call + var canConvert = converter.CanConvertFrom(typeof(NotSupportedType)); + + // Assert + Assert.IsFalse(canConvert); + } + + [Test] + public void CanConvertFrom_SourceTypeIsString_ReturnsTrue() + { + // Setup + var converter = new EnumTypeConverter(typeof(object)); + + // Call + var canConvert = converter.CanConvertFrom(typeof(string)); + + // Assert + Assert.IsTrue(canConvert); + } + + [Test] + public void ConvertFrom_ValueIsOfInvalidType_ThrowsNotSupportedException() + { + // Setup + var converter = new EnumTypeConverter(typeof(SimpleEnum)); + + // Call + TestDelegate test = () => converter.ConvertFrom(typeof(NotSupportedType)); + + // Assert + Assert.Throws(test); + } + + [Test] + public void ConvertFrom_ValueIsNull_ThrowsNotSupportedException() + { + // Setup + var converter = new EnumTypeConverter(typeof(SimpleEnum)); + + // Call + TestDelegate test = () => converter.ConvertFrom(null); + + // Assert + Assert.Throws(test); + } + + [Test] + public void ConvertFrom_ValueIsString_ReturnsExpectedEnum() + { + // Setup + const string second = ""; + var converter = new EnumTypeConverter(typeof(SimpleEnum)); + + // Call + var result = converter.ConvertFrom(second); + + // Assert + var expectedEnumValue = SimpleEnum.SecondValue; + Assert.AreEqual(expectedEnumValue, result); + } + + private enum SimpleEnum + { + [ResourcesDisplayName(typeof(Resources), "SimpleEnum_FirstValue_DisplayName")] + FirstValue, + + [ResourcesDisplayName(typeof(Resources), "SimpleEnum_SecondValue_DisplayName")] + SecondValue + } + + private class NotSupportedType {} + } +} \ No newline at end of file Index: Core/Common/test/Core.Common.Utils.Test/Properties/Resources.Designer.cs =================================================================== diff -u -rfea3ed82dfb6dfcad535eef16efcbaa9c01564ed -r0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5 --- Core/Common/test/Core.Common.Utils.Test/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision fea3ed82dfb6dfcad535eef16efcbaa9c01564ed) +++ Core/Common/test/Core.Common.Utils.Test/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5) @@ -1,28 +1,7 @@ -// Copyright (C) Stichting Deltares 2016. All rights reserved. -// -// This file is part of Ringtoets. -// -// Ringtoets is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program. If not, see . -// -// All names, logos, and references to "Deltares" are registered trademarks of -// Stichting Deltares and remain full property of Stichting Deltares at all times. -// All rights reserved. - -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.42000 +// Runtime Version:4.0.30319.18444 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -175,6 +154,24 @@ } /// + /// Looks up a localized string similar to <first>. + /// + internal static string SimpleEnum_FirstValue_DisplayName { + get { + return ResourceManager.GetString("SimpleEnum_FirstValue_DisplayName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to <second>. + /// + internal static string SimpleEnum_SecondValue_DisplayName { + get { + return ResourceManager.GetString("SimpleEnum_SecondValue_DisplayName", resourceCulture); + } + } + + /// /// Looks up a localized string similar to Awesome!. /// internal static string SomeStringResource { Index: Core/Common/test/Core.Common.Utils.Test/Properties/Resources.resx =================================================================== diff -u -r20415b2886919a103cb4677f56a8f61abbb7aa8a -r0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5 --- Core/Common/test/Core.Common.Utils.Test/Properties/Resources.resx (.../Resources.resx) (revision 20415b2886919a103cb4677f56a8f61abbb7aa8a) +++ Core/Common/test/Core.Common.Utils.Test/Properties/Resources.resx (.../Resources.resx) (revision 0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5) @@ -163,4 +163,10 @@ Display name + + <first> + + + <second> + \ No newline at end of file Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/PropertyClasses/DikeProfileBreakWaterProperties.cs =================================================================== diff -u -r780026d643daa908175ea55cf553a33ae1d8f634 -r0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5 --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/PropertyClasses/DikeProfileBreakWaterProperties.cs (.../DikeProfileBreakWaterProperties.cs) (revision 780026d643daa908175ea55cf553a33ae1d8f634) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/PropertyClasses/DikeProfileBreakWaterProperties.cs (.../DikeProfileBreakWaterProperties.cs) (revision 0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5) @@ -23,10 +23,10 @@ using Core.Common.Base.Data; using Core.Common.Gui.Attributes; using Core.Common.Gui.PropertyBag; +using Core.Common.Utils; using Core.Common.Utils.Attributes; using Ringtoets.GrassCoverErosionInwards.Data; using Ringtoets.GrassCoverErosionInwards.Forms.Properties; -using Ringtoets.GrassCoverErosionInwards.Forms.TypeConverters; namespace Ringtoets.GrassCoverErosionInwards.Forms.PropertyClasses { Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/PropertyClasses/GrassCoverErosionInwardsInputContextBreakWaterProperties.cs =================================================================== diff -u -rb491d48a58b48c595ac55d80c1885137a585b331 -r0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5 --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/PropertyClasses/GrassCoverErosionInwardsInputContextBreakWaterProperties.cs (.../GrassCoverErosionInwardsInputContextBreakWaterProperties.cs) (revision b491d48a58b48c595ac55d80c1885137a585b331) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/PropertyClasses/GrassCoverErosionInwardsInputContextBreakWaterProperties.cs (.../GrassCoverErosionInwardsInputContextBreakWaterProperties.cs) (revision 0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5) @@ -23,12 +23,12 @@ using Core.Common.Base.Data; using Core.Common.Gui.Attributes; using Core.Common.Gui.PropertyBag; +using Core.Common.Utils; using Core.Common.Utils.Attributes; using Core.Common.Utils.Reflection; using Ringtoets.GrassCoverErosionInwards.Data; using Ringtoets.GrassCoverErosionInwards.Forms.PresentationObjects; using Ringtoets.GrassCoverErosionInwards.Forms.Properties; -using Ringtoets.GrassCoverErosionInwards.Forms.TypeConverters; namespace Ringtoets.GrassCoverErosionInwards.Forms.PropertyClasses { Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Ringtoets.GrassCoverErosionInwards.Forms.csproj =================================================================== diff -u -r5a759c89e803b85ef4ef2f411547e2458cfd9bc6 -r0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5 --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Ringtoets.GrassCoverErosionInwards.Forms.csproj (.../Ringtoets.GrassCoverErosionInwards.Forms.csproj) (revision 5a759c89e803b85ef4ef2f411547e2458cfd9bc6) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Ringtoets.GrassCoverErosionInwards.Forms.csproj (.../Ringtoets.GrassCoverErosionInwards.Forms.csproj) (revision 0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5) @@ -68,7 +68,6 @@ - Fisheye: Tag 0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5 refers to a dead (removed) revision in file `Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/TypeConverters/EnumTypeConverter.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Data.Test/DikeProfileTest.cs =================================================================== diff -u -rce31448a066c084f755439f3e7d453bfb042b291 -r0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Data.Test/DikeProfileTest.cs (.../DikeProfileTest.cs) (revision ce31448a066c084f755439f3e7d453bfb042b291) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Data.Test/DikeProfileTest.cs (.../DikeProfileTest.cs) (revision 0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5) @@ -45,8 +45,8 @@ var foreshoreGeometry = new[] { - new Point2D(0.0, 1.1), - new Point2D(8.0, 9.1), + new Point2D(0.0, 1.1), + new Point2D(8.0, 9.1) }; // Call @@ -147,7 +147,7 @@ public void Constructor_ConstructionPropertiesIsNull_ThrowsArgumentNullException() { // Call - TestDelegate call = () => new DikeProfile(new Point2D(0,0), new RoughnessPoint[0], new Point2D[0], null, null); + TestDelegate call = () => new DikeProfile(new Point2D(0, 0), new RoughnessPoint[0], new Point2D[0], null, null); // Assert string paramName = Assert.Throws(call).ParamName; @@ -174,10 +174,10 @@ { // Call var dikeProfile = new DikeProfile(new Point2D(0, 0), new RoughnessPoint[0], new Point2D[0], - null, new DikeProfile.ConstructionProperties - { - DikeHeight = 1.23456 - }); + null, new DikeProfile.ConstructionProperties + { + DikeHeight = 1.23456 + }); // Assert Assert.AreEqual(2, dikeProfile.DikeHeight.NumberOfDecimalPlaces); @@ -206,7 +206,7 @@ { // Call var dikeProfile = new DikeProfile(new Point2D(0, 0), new RoughnessPoint[0], new Point2D[0], - null, new DikeProfile.ConstructionProperties()); + null, new DikeProfile.ConstructionProperties()); // Assert Assert.IsNull(dikeProfile.BreakWater); Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Data.Test/GrassCoverErosionInwardsCalculationTest.cs =================================================================== diff -u -r1051f838aebbd5977351542027ce6330583b0d43 -r0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Data.Test/GrassCoverErosionInwardsCalculationTest.cs (.../GrassCoverErosionInwardsCalculationTest.cs) (revision 1051f838aebbd5977351542027ce6330583b0d43) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Data.Test/GrassCoverErosionInwardsCalculationTest.cs (.../GrassCoverErosionInwardsCalculationTest.cs) (revision 0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5) @@ -21,7 +21,6 @@ using Core.Common.Base; using Core.Common.Base.Storage; - using NUnit.Framework; using Ringtoets.Common.Data.Calculation; using Ringtoets.Common.Data.Probability; Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Data.Test/GrassCoverErosionInwardsFailureMechanismSectionResultTest.cs =================================================================== diff -u -ra761c195a25ca9f764909e8064e933b9b5c57e01 -r0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Data.Test/GrassCoverErosionInwardsFailureMechanismSectionResultTest.cs (.../GrassCoverErosionInwardsFailureMechanismSectionResultTest.cs) (revision a761c195a25ca9f764909e8064e933b9b5c57e01) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Data.Test/GrassCoverErosionInwardsFailureMechanismSectionResultTest.cs (.../GrassCoverErosionInwardsFailureMechanismSectionResultTest.cs) (revision 0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5) @@ -20,7 +20,6 @@ // All rights reserved. using System; - using Core.Common.Base.Geometry; using Core.Common.Base.Storage; using NUnit.Framework; @@ -47,7 +46,10 @@ public void Constructor_WithSection_ResultCreatedForSection() { // Setup - var section = new FailureMechanismSection("Section", new[] { new Point2D(0, 0) }); + var section = new FailureMechanismSection("Section", new[] + { + new Point2D(0, 0) + }); // Call var result = new GrassCoverErosionInwardsFailureMechanismSectionResult(section); @@ -67,7 +69,10 @@ public void Calculation_SetNewValue_GetNewlySetValue() { // Setup - var section = new FailureMechanismSection("Section", new[] { new Point2D(0, 0) }); + var section = new FailureMechanismSection("Section", new[] + { + new Point2D(0, 0) + }); var result = new GrassCoverErosionInwardsFailureMechanismSectionResult(section); @@ -84,7 +89,10 @@ public void AssessmentLayerTwoA_CalculationNull_ReturnNaN() { // Setup - var section = new FailureMechanismSection("Section", new[] { new Point2D(0, 0) }); + var section = new FailureMechanismSection("Section", new[] + { + new Point2D(0, 0) + }); var result = new GrassCoverErosionInwardsFailureMechanismSectionResult(section) { @@ -102,7 +110,10 @@ public void AssessmentLayerTwoA_FailedCalculation_ReturnNaN() { // Setup - var section = new FailureMechanismSection("Section", new[] { new Point2D(0, 0) }); + var section = new FailureMechanismSection("Section", new[] + { + new Point2D(0, 0) + }); var probabilityAssessmentOutput = new ProbabilityAssessmentOutput(1.0, 1.0, double.NaN, 1.0, 1.0); var result = new GrassCoverErosionInwardsFailureMechanismSectionResult(section) @@ -124,7 +135,10 @@ public void AssessmentLayerTwoA_SuccessfulCalculation_ReturnProbability() { // Setup - var section = new FailureMechanismSection("Section", new[] { new Point2D(0, 0) }); + var section = new FailureMechanismSection("Section", new[] + { + new Point2D(0, 0) + }); double probability = 0.65; var probabilityAssessmentOutput = new ProbabilityAssessmentOutput(1.0, 1.0, probability, 1.0, 1.0); Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Data.Test/GrassCoverErosionInwardsFailureMechanismTest.cs =================================================================== diff -u -r53aef346fd0ee3cc79d1f5df9171c476453f2935 -r0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Data.Test/GrassCoverErosionInwardsFailureMechanismTest.cs (.../GrassCoverErosionInwardsFailureMechanismTest.cs) (revision 53aef346fd0ee3cc79d1f5df9171c476453f2935) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Data.Test/GrassCoverErosionInwardsFailureMechanismTest.cs (.../GrassCoverErosionInwardsFailureMechanismTest.cs) (revision 0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5) @@ -20,14 +20,10 @@ // All rights reserved. using System.Linq; - using Core.Common.Base; using Core.Common.Base.Geometry; - using NUnit.Framework; - using Rhino.Mocks; - using Ringtoets.Common.Data.Calculation; using Ringtoets.Common.Data.FailureMechanism; using Ringtoets.GrassCoverErosionInwards.Data.Properties; Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Data.Test/GrassCoverErosionInwardsInputTest.cs =================================================================== diff -u -r53aef346fd0ee3cc79d1f5df9171c476453f2935 -r0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Data.Test/GrassCoverErosionInwardsInputTest.cs (.../GrassCoverErosionInwardsInputTest.cs) (revision 53aef346fd0ee3cc79d1f5df9171c476453f2935) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Data.Test/GrassCoverErosionInwardsInputTest.cs (.../GrassCoverErosionInwardsInputTest.cs) (revision 0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5) @@ -20,13 +20,10 @@ // All rights reserved. using System.Collections.Generic; - using Core.Common.Base; using Core.Common.Base.Data; using Core.Common.Base.Geometry; - using NUnit.Framework; - using Ringtoets.Common.Data.Calculation; using Ringtoets.Common.Data.Probabilistics; using Ringtoets.HydraRing.Data; @@ -234,8 +231,8 @@ // Call input.CriticalFlowRate = new LogNormalDistribution(10) { - Mean = (RoundedDouble)meanValue, - StandardDeviation = (RoundedDouble)standardDeviationValue + Mean = (RoundedDouble) meanValue, + StandardDeviation = (RoundedDouble) standardDeviationValue }; // Assert Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Data.Test/GrassCoverErosionInwardsOutputTest.cs =================================================================== diff -u -r7f759fbabca9c41e75d229269f1b21581b373b5f -r0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Data.Test/GrassCoverErosionInwardsOutputTest.cs (.../GrassCoverErosionInwardsOutputTest.cs) (revision 7f759fbabca9c41e75d229269f1b21581b373b5f) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Data.Test/GrassCoverErosionInwardsOutputTest.cs (.../GrassCoverErosionInwardsOutputTest.cs) (revision 0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5) @@ -22,7 +22,6 @@ using Core.Common.Base; using Core.Common.Base.Data; using Core.Common.Base.Storage; - using NUnit.Framework; using Ringtoets.Common.Data.Calculation; using Ringtoets.Common.Data.Probability; @@ -103,7 +102,7 @@ GrassCoverErosionInwardsOutput output = new GrassCoverErosionInwardsOutput(double.NaN, false, new ProbabilityAssessmentOutput(double.NaN, double.NaN, double.NaN, double.NaN, double.NaN), 12.8276); // Assert - Assert.AreEqual((RoundedDouble)12.83, output.DikeHeight); + Assert.AreEqual((RoundedDouble) 12.83, output.DikeHeight); } } } \ No newline at end of file Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Data.Test/Ringtoets.GrassCoverErosionInwards.Data.Test.csproj =================================================================== diff -u -r3d84064b23186da3fb11f19ff0d07f41e1209bbb -r0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Data.Test/Ringtoets.GrassCoverErosionInwards.Data.Test.csproj (.../Ringtoets.GrassCoverErosionInwards.Data.Test.csproj) (revision 3d84064b23186da3fb11f19ff0d07f41e1209bbb) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Data.Test/Ringtoets.GrassCoverErosionInwards.Data.Test.csproj (.../Ringtoets.GrassCoverErosionInwards.Data.Test.csproj) (revision 0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5) @@ -82,10 +82,6 @@ {D4200F43-3F72-4F42-AF0A-8CED416A38EC} Ringtoets.Common.Data - - {4843d6e5-066f-4795-94f5-1d53932dd03c} - Ringtoets.Common.Data.TestUtil - {70f8cc9c-5bc8-4fb2-b201-eae7fa8088c2} Ringtoets.HydraRing.Data Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PresentationObjects/DikeProfilesContextTest.cs =================================================================== diff -u -r454c559173fa5069917f2aab1a4d65ddbb019b3a -r0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PresentationObjects/DikeProfilesContextTest.cs (.../DikeProfilesContextTest.cs) (revision 454c559173fa5069917f2aab1a4d65ddbb019b3a) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PresentationObjects/DikeProfilesContextTest.cs (.../DikeProfilesContextTest.cs) (revision 0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5) @@ -20,14 +20,10 @@ // All rights reserved. using System; - using Core.Common.Base; using Core.Common.Controls.PresentationObjects; - using NUnit.Framework; - using Rhino.Mocks; - using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.GrassCoverErosionInwards.Data; using Ringtoets.GrassCoverErosionInwards.Forms.PresentationObjects; Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PresentationObjects/GrassCoverErosionInwardsScenariosContextTest.cs =================================================================== diff -u -r9bd00cf5c538409ebb1c1c68f90ca0146e93d155 -r0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PresentationObjects/GrassCoverErosionInwardsScenariosContextTest.cs (.../GrassCoverErosionInwardsScenariosContextTest.cs) (revision 9bd00cf5c538409ebb1c1c68f90ca0146e93d155) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PresentationObjects/GrassCoverErosionInwardsScenariosContextTest.cs (.../GrassCoverErosionInwardsScenariosContextTest.cs) (revision 0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5) @@ -20,9 +20,7 @@ // All rights reserved. using Core.Common.Controls.PresentationObjects; - using NUnit.Framework; - using Ringtoets.Common.Data.Calculation; using Ringtoets.GrassCoverErosionInwards.Data; using Ringtoets.GrassCoverErosionInwards.Forms.PresentationObjects; Fisheye: Tag 0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5 refers to a dead (removed) revision in file `Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Properties/Resources.Designer.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5 refers to a dead (removed) revision in file `Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Properties/Resources.resx'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PropertyClasses/GrassCoverErosionInwardsInputContextDikeGeometryPropertiesTest.cs =================================================================== diff -u -r53aef346fd0ee3cc79d1f5df9171c476453f2935 -r0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PropertyClasses/GrassCoverErosionInwardsInputContextDikeGeometryPropertiesTest.cs (.../GrassCoverErosionInwardsInputContextDikeGeometryPropertiesTest.cs) (revision 53aef346fd0ee3cc79d1f5df9171c476453f2935) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PropertyClasses/GrassCoverErosionInwardsInputContextDikeGeometryPropertiesTest.cs (.../GrassCoverErosionInwardsInputContextDikeGeometryPropertiesTest.cs) (revision 0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5) @@ -90,7 +90,7 @@ new RoughnessPoint(new Point2D(1.1, 2.2), 0.6), new RoughnessPoint(new Point2D(3.3, 4.4), 0.7) }, new Point2D[0], null, new DikeProfile.ConstructionProperties()); - + var calculation = new GrassCoverErosionInwardsCalculation { InputParameters = Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PropertyClasses/GrassCoverErosionInwardsOutputPropertiesTest.cs =================================================================== diff -u -r5684fb6e48e9aee390eb2eaf6858cbf077b00599 -r0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PropertyClasses/GrassCoverErosionInwardsOutputPropertiesTest.cs (.../GrassCoverErosionInwardsOutputPropertiesTest.cs) (revision 5684fb6e48e9aee390eb2eaf6858cbf077b00599) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PropertyClasses/GrassCoverErosionInwardsOutputPropertiesTest.cs (.../GrassCoverErosionInwardsOutputPropertiesTest.cs) (revision 0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5) @@ -160,7 +160,7 @@ Assert.AreEqual("Indicatieve golfhoogte", isDominantProperty.Category); Assert.AreEqual("Overslag dominant [-]", isDominantProperty.DisplayName); Assert.AreEqual("Is het resultaat van de overslag deelberekening dominant over de overloop deelberekening.", isDominantProperty.Description); - + PropertyDescriptor dikeHeightProperty = dynamicProperties[dikeHeightIndex]; Assert.IsTrue(dikeHeightProperty.IsReadOnly); Assert.AreEqual("Resultaat", dikeHeightProperty.Category); Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Ringtoets.GrassCoverErosionInwards.Forms.Test.csproj =================================================================== diff -u -r3d84064b23186da3fb11f19ff0d07f41e1209bbb -r0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Ringtoets.GrassCoverErosionInwards.Forms.Test.csproj (.../Ringtoets.GrassCoverErosionInwards.Forms.Test.csproj) (revision 3d84064b23186da3fb11f19ff0d07f41e1209bbb) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Ringtoets.GrassCoverErosionInwards.Forms.Test.csproj (.../Ringtoets.GrassCoverErosionInwards.Forms.Test.csproj) (revision 0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5) @@ -64,11 +64,6 @@ - - True - True - Resources.resx - @@ -96,7 +91,6 @@ - @@ -184,12 +178,6 @@ Ringtoets.GrassCoverErosionInwards.Plugin - - - ResXFileCodeGenerator - Resources.Designer.cs - - Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/TreeNodeInfos/DikeProfileTreeNodeInfoTest.cs =================================================================== diff -u -r53aef346fd0ee3cc79d1f5df9171c476453f2935 -r0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/TreeNodeInfos/DikeProfileTreeNodeInfoTest.cs (.../DikeProfileTreeNodeInfoTest.cs) (revision 53aef346fd0ee3cc79d1f5df9171c476453f2935) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/TreeNodeInfos/DikeProfileTreeNodeInfoTest.cs (.../DikeProfileTreeNodeInfoTest.cs) (revision 0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5) @@ -131,4 +131,4 @@ mocks.VerifyAll(); } } -} +} \ No newline at end of file Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/TreeNodeInfos/DikeProfilesContextTreeNodeInfoTest.cs =================================================================== diff -u -r53aef346fd0ee3cc79d1f5df9171c476453f2935 -r0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/TreeNodeInfos/DikeProfilesContextTreeNodeInfoTest.cs (.../DikeProfilesContextTreeNodeInfoTest.cs) (revision 53aef346fd0ee3cc79d1f5df9171c476453f2935) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/TreeNodeInfos/DikeProfilesContextTreeNodeInfoTest.cs (.../DikeProfilesContextTreeNodeInfoTest.cs) (revision 0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5) @@ -21,23 +21,18 @@ using System.Drawing; using System.Linq; - using Core.Common.Base; using Core.Common.Base.Geometry; using Core.Common.Controls.TreeView; using Core.Common.Gui; using Core.Common.Gui.ContextMenu; using Core.Common.TestUtil; - using NUnit.Framework; - using Rhino.Mocks; - using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.GrassCoverErosionInwards.Data; using Ringtoets.GrassCoverErosionInwards.Forms.PresentationObjects; using Ringtoets.GrassCoverErosionInwards.Plugin; - using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources; namespace Ringtoets.GrassCoverErosionInwards.Forms.Test.TreeNodeInfos Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/TreeNodeInfos/GrassCoverErosionInwardsCalculationContextTreeNodeInfoTest.cs =================================================================== diff -u -r4b647301c81c13810237268da2364d1568ad186d -r0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/TreeNodeInfos/GrassCoverErosionInwardsCalculationContextTreeNodeInfoTest.cs (.../GrassCoverErosionInwardsCalculationContextTreeNodeInfoTest.cs) (revision 4b647301c81c13810237268da2364d1568ad186d) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/TreeNodeInfos/GrassCoverErosionInwardsCalculationContextTreeNodeInfoTest.cs (.../GrassCoverErosionInwardsCalculationContextTreeNodeInfoTest.cs) (revision 0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5) @@ -66,14 +66,6 @@ info = plugin.GetTreeNodeInfos().First(tni => tni.TagType == typeof(GrassCoverErosionInwardsCalculationContext)); } - public override void TearDown() - { - plugin.Dispose(); - mocks.VerifyAll(); - - base.TearDown(); - } - [Test] public void Initialized_Always_ExpectedPropertiesSet() { @@ -803,6 +795,14 @@ Assert.IsNull(sectionResult.Calculation); } + public override void TearDown() + { + plugin.Dispose(); + mocks.VerifyAll(); + + base.TearDown(); + } + private const int contextMenuValidateIndex = 0; private const int contextMenuCalculateIndex = 1; private const int contextMenuClearIndex = 2; Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/TreeNodeInfos/GrassCoverErosionInwardsFailureMechanismContextTreeNodeInfoTest.cs =================================================================== diff -u -r4b647301c81c13810237268da2364d1568ad186d -r0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/TreeNodeInfos/GrassCoverErosionInwardsFailureMechanismContextTreeNodeInfoTest.cs (.../GrassCoverErosionInwardsFailureMechanismContextTreeNodeInfoTest.cs) (revision 4b647301c81c13810237268da2364d1568ad186d) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/TreeNodeInfos/GrassCoverErosionInwardsFailureMechanismContextTreeNodeInfoTest.cs (.../GrassCoverErosionInwardsFailureMechanismContextTreeNodeInfoTest.cs) (revision 0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5) @@ -22,7 +22,6 @@ using System.IO; using System.Linq; using System.Windows.Forms; - using Core.Common.Base.Geometry; using Core.Common.Controls.TreeView; using Core.Common.Gui; @@ -31,12 +30,9 @@ using Core.Common.Gui.Forms.MainWindow; using Core.Common.Gui.TestUtil.ContextMenu; using Core.Common.TestUtil; - using NUnit.Extensions.Forms; using NUnit.Framework; - using Rhino.Mocks; - using Ringtoets.Common.Data; using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.Common.Data.FailureMechanism; @@ -45,7 +41,6 @@ using Ringtoets.GrassCoverErosionInwards.Forms.PresentationObjects; using Ringtoets.GrassCoverErosionInwards.Plugin; using Ringtoets.HydraRing.Data; - using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources; using GrassCoverErosionInwardsFormsResources = Ringtoets.GrassCoverErosionInwards.Forms.Properties.Resources; using CoreCommonGuiResources = Core.Common.Gui.Properties.Resources; @@ -113,35 +108,35 @@ // Assert Assert.AreEqual(3, children.Length); - var inputsFolder = (CategoryTreeFolder)children[0]; + var inputsFolder = (CategoryTreeFolder) children[0]; Assert.AreEqual("Invoer", inputsFolder.Name); Assert.AreEqual(TreeFolderCategory.Input, inputsFolder.Category); Assert.AreEqual(3, inputsFolder.Contents.Count); - var failureMechanismSectionsContext = (FailureMechanismSectionsContext)inputsFolder.Contents[0]; + var failureMechanismSectionsContext = (FailureMechanismSectionsContext) inputsFolder.Contents[0]; Assert.AreSame(failureMechanism, failureMechanismSectionsContext.WrappedData); Assert.AreSame(assessmentSectionMock, failureMechanismSectionsContext.ParentAssessmentSection); - var dikeProfilesContext = (DikeProfilesContext)inputsFolder.Contents[1]; + var dikeProfilesContext = (DikeProfilesContext) inputsFolder.Contents[1]; Assert.AreSame(failureMechanism.DikeProfiles, dikeProfilesContext.WrappedData); Assert.AreSame(assessmentSectionMock, dikeProfilesContext.ParentAssessmentSection); - var commentContext = (CommentContext)inputsFolder.Contents[2]; + var commentContext = (CommentContext) inputsFolder.Contents[2]; Assert.AreSame(failureMechanism, commentContext.WrappedData); - var calculationsFolder = (GrassCoverErosionInwardsCalculationGroupContext)children[1]; + var calculationsFolder = (GrassCoverErosionInwardsCalculationGroupContext) children[1]; Assert.AreEqual("Berekeningen", calculationsFolder.WrappedData.Name); Assert.AreSame(failureMechanism.CalculationsGroup, calculationsFolder.WrappedData); Assert.AreSame(failureMechanism, calculationsFolder.FailureMechanism); - var outputsFolder = (CategoryTreeFolder)children[2]; + var outputsFolder = (CategoryTreeFolder) children[2]; Assert.AreEqual("Oordeel", outputsFolder.Name); Assert.AreEqual(TreeFolderCategory.Output, outputsFolder.Category); Assert.AreEqual(2, outputsFolder.Contents.Count); - var scenariosContext = (GrassCoverErosionInwardsScenariosContext)outputsFolder.Contents[0]; + var scenariosContext = (GrassCoverErosionInwardsScenariosContext) outputsFolder.Contents[0]; Assert.AreSame(failureMechanism.CalculationsGroup, scenariosContext.WrappedData); Assert.AreSame(failureMechanism, scenariosContext.ParentFailureMechanism); - var failureMechanismResultsContext = (FailureMechanismSectionResultContext)outputsFolder.Contents[1]; + var failureMechanismResultsContext = (FailureMechanismSectionResultContext) outputsFolder.Contents[1]; Assert.AreSame(failureMechanism, failureMechanismResultsContext.FailureMechanism); Assert.AreSame(failureMechanism.SectionResults, failureMechanismResultsContext.WrappedData); } @@ -164,7 +159,7 @@ // Assert Assert.AreEqual(1, children.Length); - var commentContext = (CommentContext)children[0]; + var commentContext = (CommentContext) children[0]; Assert.AreSame(failureMechanism, commentContext.WrappedData); } Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/TreeNodeInfos/GrassCoverErosionInwardsOutputTreeNodeInfoTest.cs =================================================================== diff -u -r7f759fbabca9c41e75d229269f1b21581b373b5f -r0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/TreeNodeInfos/GrassCoverErosionInwardsOutputTreeNodeInfoTest.cs (.../GrassCoverErosionInwardsOutputTreeNodeInfoTest.cs) (revision 7f759fbabca9c41e75d229269f1b21581b373b5f) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/TreeNodeInfos/GrassCoverErosionInwardsOutputTreeNodeInfoTest.cs (.../GrassCoverErosionInwardsOutputTreeNodeInfoTest.cs) (revision 0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5) @@ -117,7 +117,6 @@ menuBuilderMock.Expect(mb => mb.AddPropertiesItem()).Return(menuBuilderMock); menuBuilderMock.Expect(mb => mb.Build()).Return(null); - using (var treeViewControl = new TreeViewControl()) { guiMock.Expect(cmp => cmp.Get(null, treeViewControl)).Return(menuBuilderMock); Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/TreeNodeInfos/GrassCoverErosionInwardsScenariosContextTreeNodeInfoTest.cs =================================================================== diff -u -ra1ec5faebf7ccf8e67fa34a2b73cd1063ab48840 -r0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/TreeNodeInfos/GrassCoverErosionInwardsScenariosContextTreeNodeInfoTest.cs (.../GrassCoverErosionInwardsScenariosContextTreeNodeInfoTest.cs) (revision a1ec5faebf7ccf8e67fa34a2b73cd1063ab48840) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/TreeNodeInfos/GrassCoverErosionInwardsScenariosContextTreeNodeInfoTest.cs (.../GrassCoverErosionInwardsScenariosContextTreeNodeInfoTest.cs) (revision 0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5) @@ -21,21 +21,17 @@ using System.Drawing; using System.Linq; - using Core.Common.Controls.TreeView; using Core.Common.Gui; using Core.Common.Gui.ContextMenu; using Core.Common.TestUtil; - using NUnit.Framework; - using Rhino.Mocks; - using Ringtoets.Common.Data.Calculation; +using Ringtoets.Common.Forms.Properties; using Ringtoets.GrassCoverErosionInwards.Data; using Ringtoets.GrassCoverErosionInwards.Forms.PresentationObjects; using Ringtoets.GrassCoverErosionInwards.Plugin; -using Resources = Ringtoets.Common.Forms.Properties.Resources; namespace Ringtoets.GrassCoverErosionInwards.Forms.Test.TreeNodeInfos { Fisheye: Tag 0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5 refers to a dead (removed) revision in file `Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/TypeConverters/EnumTypeConverterTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/UITypeEditors/GrassCoverErosionInwardsInputContextDikeProfileEditorTest.cs =================================================================== diff -u -r53aef346fd0ee3cc79d1f5df9171c476453f2935 -r0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/UITypeEditors/GrassCoverErosionInwardsInputContextDikeProfileEditorTest.cs (.../GrassCoverErosionInwardsInputContextDikeProfileEditorTest.cs) (revision 53aef346fd0ee3cc79d1f5df9171c476453f2935) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/UITypeEditors/GrassCoverErosionInwardsInputContextDikeProfileEditorTest.cs (.../GrassCoverErosionInwardsInputContextDikeProfileEditorTest.cs) (revision 0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5) @@ -100,7 +100,10 @@ null, new DikeProfile.ConstructionProperties()); var failureMechanism = new GrassCoverErosionInwardsFailureMechanism { - DikeProfiles = { dikeProfile } + DikeProfiles = + { + dikeProfile + } }; var grassCoverErosionInwardsInput = new GrassCoverErosionInwardsInput { Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Views/GrassCoverErosionInwardsChartDataPointsFactoryTest.cs =================================================================== diff -u -r848c3a050bda5fb0dd74232deb7f1d5eba8ecbf6 -r0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Views/GrassCoverErosionInwardsChartDataPointsFactoryTest.cs (.../GrassCoverErosionInwardsChartDataPointsFactoryTest.cs) (revision 848c3a050bda5fb0dd74232deb7f1d5eba8ecbf6) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Views/GrassCoverErosionInwardsChartDataPointsFactoryTest.cs (.../GrassCoverErosionInwardsChartDataPointsFactoryTest.cs) (revision 0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5) @@ -228,4 +228,4 @@ }, points); } } -} +} \ No newline at end of file Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Views/GrassCoverErosionInwardsFailureMechanismResultViewTest.cs =================================================================== diff -u -rb954fb6f2dd56ffb96be7b61ab129f19d879d2ab -r0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Views/GrassCoverErosionInwardsFailureMechanismResultViewTest.cs (.../GrassCoverErosionInwardsFailureMechanismResultViewTest.cs) (revision b954fb6f2dd56ffb96be7b61ab129f19d879d2ab) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Views/GrassCoverErosionInwardsFailureMechanismResultViewTest.cs (.../GrassCoverErosionInwardsFailureMechanismResultViewTest.cs) (revision 0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5) @@ -24,13 +24,10 @@ using System.Drawing; using System.Linq; using System.Windows.Forms; - using Core.Common.Base.Data; using Core.Common.Base.Geometry; - using NUnit.Extensions.Forms; using NUnit.Framework; - using Ringtoets.Common.Data.FailureMechanism; using Ringtoets.Common.Data.Probability; using Ringtoets.Common.Forms.Helpers; @@ -76,7 +73,7 @@ using (ShowFailureMechanismResultsView()) { // Assert - var dataGridView = (DataGridView)new ControlTester("dataGridView").TheObject; + var dataGridView = (DataGridView) new ControlTester("dataGridView").TheObject; Assert.AreEqual(4, dataGridView.ColumnCount); Assert.IsTrue(dataGridView.Columns[assessmentLayerTwoAIndex].ReadOnly); @@ -98,7 +95,7 @@ // Setup using (var view = ShowFullyConfiguredFailureMechanismResultsView()) { - var dataGridView = (DataGridView)new ControlTester("dataGridView").TheObject; + var dataGridView = (DataGridView) new ControlTester("dataGridView").TheObject; FailureMechanismSection section = CreateSimpleFailureMechanismSection(); var sectionResult = new GrassCoverErosionInwardsFailureMechanismSectionResult(section); @@ -128,7 +125,7 @@ var testData = new object(); using (var view = ShowFullyConfiguredFailureMechanismResultsView()) { - var dataGridView = (DataGridView)new ControlTester("dataGridView").TheObject; + var dataGridView = (DataGridView) new ControlTester("dataGridView").TheObject; // Call view.Data = testData; @@ -146,7 +143,7 @@ // Setup & Call using (ShowFullyConfiguredFailureMechanismResultsView()) { - var dataGridView = (DataGridView)new ControlTester("dataGridView").TheObject; + var dataGridView = (DataGridView) new ControlTester("dataGridView").TheObject; // Assert var rows = dataGridView.Rows; @@ -155,14 +152,14 @@ var cells = rows[0].Cells; Assert.AreEqual(4, cells.Count); Assert.AreEqual("Section 1", cells[nameColumnIndex].FormattedValue); - Assert.IsFalse((bool)cells[assessmentLayerOneIndex].FormattedValue); + Assert.IsFalse((bool) cells[assessmentLayerOneIndex].FormattedValue); Assert.AreEqual("-", cells[assessmentLayerTwoAIndex].FormattedValue); Assert.AreEqual("-", cells[assessmentLayerThreeIndex].FormattedValue); cells = rows[1].Cells; Assert.AreEqual(4, cells.Count); Assert.AreEqual("Section 2", cells[nameColumnIndex].FormattedValue); - Assert.IsFalse((bool)cells[assessmentLayerOneIndex].FormattedValue); + Assert.IsFalse((bool) cells[assessmentLayerOneIndex].FormattedValue); Assert.AreEqual("-", cells[assessmentLayerTwoAIndex].FormattedValue); Assert.AreEqual("-", cells[assessmentLayerThreeIndex].FormattedValue); } @@ -177,7 +174,7 @@ // Setup using (ShowFullyConfiguredFailureMechanismResultsView()) { - var dataGridView = (DataGridView)new ControlTester("dataGridView").TheObject; + var dataGridView = (DataGridView) new ControlTester("dataGridView").TheObject; // Call dataGridView.Rows[0].Cells[assessmentLayerOneIndex].Value = checkBoxSelected; @@ -191,7 +188,7 @@ var cellAssessmentLayerTwoA = cells[assessmentLayerTwoAIndex]; var cellAssessmentLayerThree = cells[assessmentLayerThreeIndex]; - Assert.AreEqual(checkBoxSelected, (bool)cells[assessmentLayerOneIndex].FormattedValue); + Assert.AreEqual(checkBoxSelected, (bool) cells[assessmentLayerOneIndex].FormattedValue); Assert.AreEqual("-", cellAssessmentLayerTwoA.FormattedValue); Assert.AreEqual("-", cellAssessmentLayerThree.FormattedValue); @@ -227,7 +224,7 @@ // Setup using (ShowFullyConfiguredFailureMechanismResultsView()) { - var dataGridView = (DataGridView)new ControlTester("dataGridView").TheObject; + var dataGridView = (DataGridView) new ControlTester("dataGridView").TheObject; // Call dataGridView.Rows[0].Cells[cellIndex].Value = newValue; @@ -247,7 +244,7 @@ // Setup using (var view = ShowFullyConfiguredFailureMechanismResultsView()) { - var dataGridView = (DataGridView)new ControlTester("dataGridView").TheObject; + var dataGridView = (DataGridView) new ControlTester("dataGridView").TheObject; // Call dataGridView.Rows[0].Cells[cellIndex].Value = newValue; @@ -261,7 +258,7 @@ var propertyValue = row.GetType().GetProperty(propertyName).GetValue(row, null); - Assert.AreEqual((RoundedDouble)double.Parse(newValue), propertyValue); + Assert.AreEqual((RoundedDouble) double.Parse(newValue), propertyValue); } } @@ -271,11 +268,11 @@ // Setup using (var view = ShowFullyConfiguredFailureMechanismResultsView()) { - var sections = (List)view.Data; + var sections = (List) view.Data; sections[0].AssessmentLayerOne = false; var gridTester = new ControlTester("dataGridView"); - var dataGridView = (DataGridView)gridTester.TheObject; + var dataGridView = (DataGridView) gridTester.TheObject; var dataGridViewCell = dataGridView.Rows[0].Cells[assessmentLayerOneIndex]; dataGridView.CurrentCell = dataGridViewCell; @@ -305,7 +302,7 @@ }; var gridTester = new ControlTester("dataGridView"); - var dataGridView = (DataGridView)gridTester.TheObject; + var dataGridView = (DataGridView) gridTester.TheObject; DataGridViewCell dataGridViewCell = dataGridView.Rows[0].Cells[assessmentLayerTwoAIndex]; @@ -337,7 +334,7 @@ }; var gridTester = new ControlTester("dataGridView"); - var dataGridView = (DataGridView)gridTester.TheObject; + var dataGridView = (DataGridView) gridTester.TheObject; DataGridViewCell dataGridViewCell = dataGridView.Rows[0].Cells[assessmentLayerTwoAIndex]; @@ -373,7 +370,7 @@ }; var gridTester = new ControlTester("dataGridView"); - var dataGridView = (DataGridView)gridTester.TheObject; + var dataGridView = (DataGridView) gridTester.TheObject; DataGridViewCell dataGridViewCell = dataGridView.Rows[0].Cells[assessmentLayerTwoAIndex]; @@ -410,7 +407,7 @@ }; var gridTester = new ControlTester("dataGridView"); - var dataGridView = (DataGridView)gridTester.TheObject; + var dataGridView = (DataGridView) gridTester.TheObject; DataGridViewCell dataGridViewCell = dataGridView.Rows[0].Cells[assessmentLayerTwoAIndex]; @@ -453,7 +450,7 @@ }; var gridTester = new ControlTester("dataGridView"); - var dataGridView = (DataGridView)gridTester.TheObject; + var dataGridView = (DataGridView) gridTester.TheObject; DataGridViewCell dataGridViewCell = dataGridView.Rows[0].Cells[assessmentLayerTwoAIndex]; Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Views/GrassCoverErosionInwardsFailureMechanismSectionResultRowTest.cs =================================================================== diff -u -r90deb88f193d2b0eb45c013b1101864c298a18d5 -r0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Views/GrassCoverErosionInwardsFailureMechanismSectionResultRowTest.cs (.../GrassCoverErosionInwardsFailureMechanismSectionResultRowTest.cs) (revision 90deb88f193d2b0eb45c013b1101864c298a18d5) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Views/GrassCoverErosionInwardsFailureMechanismSectionResultRowTest.cs (.../GrassCoverErosionInwardsFailureMechanismSectionResultRowTest.cs) (revision 0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5) @@ -20,16 +20,12 @@ // All rights reserved. using System; - using Core.Common.Base; using Core.Common.Base.Data; using Core.Common.Base.Geometry; using Core.Common.Utils.Reflection; - using NUnit.Framework; - using Rhino.Mocks; - using Ringtoets.Common.Data.Calculation; using Ringtoets.Common.Data.FailureMechanism; using Ringtoets.Common.Data.Probability; @@ -186,7 +182,7 @@ var row = new GrassCoverErosionInwardsFailureMechanismSectionResultRow(result); // Call - row.AssessmentLayerThree = (RoundedDouble)newValue; + row.AssessmentLayerThree = (RoundedDouble) newValue; // Assert Assert.AreEqual(newValue, result.AssessmentLayerThree, row.AssessmentLayerThree.GetAccuracy()); Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Views/GrassCoverErosionInwardsScenarioRowTest.cs =================================================================== diff -u -rd207738be4ce6f50f4e3e00839ea433acea10bbd -r0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Views/GrassCoverErosionInwardsScenarioRowTest.cs (.../GrassCoverErosionInwardsScenarioRowTest.cs) (revision d207738be4ce6f50f4e3e00839ea433acea10bbd) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Views/GrassCoverErosionInwardsScenarioRowTest.cs (.../GrassCoverErosionInwardsScenarioRowTest.cs) (revision 0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5) @@ -20,14 +20,10 @@ // All rights reserved. using System; - using Core.Common.Base; using Core.Common.Base.Geometry; - using NUnit.Framework; - using Rhino.Mocks; - using Ringtoets.Common.Data.FailureMechanism; using Ringtoets.GrassCoverErosionInwards.Data; using Ringtoets.GrassCoverErosionInwards.Forms.Views; @@ -88,8 +84,6 @@ // Assert Assert.AreSame(calculation, row.Calculation); Assert.AreSame(calculation, sectionResult.Calculation); - - } [Test] Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/DikeProfiles/DikeProfileDataReaderTest.cs =================================================================== diff -u -rce31448a066c084f755439f3e7d453bfb042b291 -r0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/DikeProfiles/DikeProfileDataReaderTest.cs (.../DikeProfileDataReaderTest.cs) (revision ce31448a066c084f755439f3e7d453bfb042b291) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/DikeProfiles/DikeProfileDataReaderTest.cs (.../DikeProfileDataReaderTest.cs) (revision 0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5) @@ -21,13 +21,10 @@ using System; using System.IO; - using Core.Common.Base.Geometry; using Core.Common.IO.Exceptions; using Core.Common.TestUtil; - using NUnit.Framework; - using Ringtoets.GrassCoverErosionInwards.IO.DikeProfiles; namespace Ringtoets.GrassCoverErosionInwards.IO.Test.DikeProfiles Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/DikeProfiles/DikeProfileDataTest.cs =================================================================== diff -u -r3ce8a0c103af363c8e00798d95588ebe4d1e04a5 -r0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/DikeProfiles/DikeProfileDataTest.cs (.../DikeProfileDataTest.cs) (revision 3ce8a0c103af363c8e00798d95588ebe4d1e04a5) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/DikeProfiles/DikeProfileDataTest.cs (.../DikeProfileDataTest.cs) (revision 0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5) @@ -21,11 +21,8 @@ using System; using System.Linq; - using Core.Common.Base.Geometry; - using NUnit.Framework; - using Ringtoets.GrassCoverErosionInwards.Data; using Ringtoets.GrassCoverErosionInwards.IO.DikeProfiles; @@ -71,7 +68,7 @@ public void Orientation_SetNewValue_GetNewlySetValue() { // Setup - var newValue = new Random(21).NextDouble() * 360; + var newValue = new Random(21).NextDouble()*360; var dikeProfileData = new DikeProfileData(); // Call @@ -129,7 +126,7 @@ public void SheetPilingType_SetNewValue_GetsNewlySetValue() { // Setup - var index = new Random(21).Next(0,3); + var index = new Random(21).Next(0, 3); var dikeProfileData = new DikeProfileData(); SheetPileType newValue = Enum.GetValues(typeof(SheetPileType)).OfType().ElementAt(index); @@ -164,7 +161,7 @@ var newValue = new[] { - new RoughnessPoint(new Point2D(0, 0), 1.0), + new RoughnessPoint(new Point2D(0, 0), 1.0), new RoughnessPoint(new Point2D(1, 1), 0.9) }; @@ -183,7 +180,7 @@ var newValue = new[] { - new RoughnessPoint(new Point2D(1, 1), 1.0), + new RoughnessPoint(new Point2D(1, 1), 1.0), new RoughnessPoint(new Point2D(3, 3), 0.9) }; Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/DikeProfiles/DikeProfileLocationReaderTest.cs =================================================================== diff -u -rfea3ed82dfb6dfcad535eef16efcbaa9c01564ed -r0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/DikeProfiles/DikeProfileLocationReaderTest.cs (.../DikeProfileLocationReaderTest.cs) (revision fea3ed82dfb6dfcad535eef16efcbaa9c01564ed) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/DikeProfiles/DikeProfileLocationReaderTest.cs (.../DikeProfileLocationReaderTest.cs) (revision 0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5) @@ -26,7 +26,6 @@ using Core.Common.IO.Exceptions; using Core.Common.TestUtil; using NUnit.Framework; - using Ringtoets.GrassCoverErosionInwards.IO.DikeProfiles; namespace Ringtoets.GrassCoverErosionInwards.IO.Test.DikeProfiles @@ -39,7 +38,7 @@ { // Setup string validFilePath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.GrassCoverErosionInwards.IO, - Path.Combine("DikeProfiles", "Voorlanden 12-2.shp")); + Path.Combine("DikeProfiles", "Voorlanden 12-2.shp")); // Call using (var reader = new DikeProfileLocationReader(validFilePath)) @@ -148,7 +147,7 @@ { // Setup string invalidFilePath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.GrassCoverErosionInwards.IO, - Path.Combine("DikeProfiles", fileName)); + Path.Combine("DikeProfiles", fileName)); // Call TestDelegate call = () => new DikeProfileLocationReader(invalidFilePath); @@ -165,7 +164,7 @@ { // Setup string validFilePath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.GrassCoverErosionInwards.IO, - Path.Combine("DikeProfiles", "Voorlanden 12-2.shp")); + Path.Combine("DikeProfiles", "Voorlanden 12-2.shp")); using (var reader = new DikeProfileLocationReader(validFilePath)) { @@ -185,7 +184,7 @@ { // Setup string validFilePath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.GrassCoverErosionInwards.IO, - Path.Combine("DikeProfiles", fileName)); + Path.Combine("DikeProfiles", fileName)); IList dikeProfileLocations = new List(); using (var reader = new DikeProfileLocationReader(validFilePath)) @@ -207,7 +206,7 @@ { // Setup string invalidFilePath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.GrassCoverErosionInwards.IO, - Path.Combine("DikeProfiles", "Voorlanden_12-2_EmptyId.shp")); + Path.Combine("DikeProfiles", "Voorlanden_12-2_EmptyId.shp")); using (var reader = new DikeProfileLocationReader(invalidFilePath)) { @@ -226,7 +225,7 @@ { // Setup string invalidFilePath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.GrassCoverErosionInwards.IO, - Path.Combine("DikeProfiles", "Voorlanden_12-2_EmptyX0.shp")); + Path.Combine("DikeProfiles", "Voorlanden_12-2_EmptyX0.shp")); using (var reader = new DikeProfileLocationReader(invalidFilePath)) { @@ -247,7 +246,7 @@ { // Setup string invalidFilePath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.GrassCoverErosionInwards.IO, - Path.Combine("DikeProfiles", fileName)); + Path.Combine("DikeProfiles", fileName)); using (var reader = new DikeProfileLocationReader(invalidFilePath)) { @@ -266,7 +265,7 @@ { // Setup string invalidFilePath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.GrassCoverErosionInwards.IO, - Path.Combine("DikeProfiles", "Voorlanden_12-2_EmptyName.shp")); + Path.Combine("DikeProfiles", "Voorlanden_12-2_EmptyName.shp")); IList dikeProfileLocations = new List(); using (var reader = new DikeProfileLocationReader(invalidFilePath)) @@ -288,7 +287,7 @@ { // Setup string validFilePath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.GrassCoverErosionInwards.IO, - Path.Combine("DikeProfiles", "Voorlanden 12-2.shp")); + Path.Combine("DikeProfiles", "Voorlanden 12-2.shp")); IList dikeProfileLocations = new List(); using (var reader = new DikeProfileLocationReader(validFilePath)) @@ -326,7 +325,7 @@ { // Setup string validFilePath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.GrassCoverErosionInwards.IO, - Path.Combine("DikeProfiles", "Voorlanden 12-2.shp")); + Path.Combine("DikeProfiles", "Voorlanden 12-2.shp")); IList dikeProfileLocations = new List(); using (var reader = new DikeProfileLocationReader(validFilePath)) @@ -352,7 +351,7 @@ { // Setup string validFilePath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.GrassCoverErosionInwards.IO, - Path.Combine("DikeProfiles", "Voorlanden 12-2.shp")); + Path.Combine("DikeProfiles", "Voorlanden 12-2.shp")); IList dikeProfileLocations = new List(); using (var reader = new DikeProfileLocationReader(validFilePath)) Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/Ringtoets.GrassCoverErosionInwards.IO.Test.csproj =================================================================== diff -u -r3d84064b23186da3fb11f19ff0d07f41e1209bbb -r0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/Ringtoets.GrassCoverErosionInwards.IO.Test.csproj (.../Ringtoets.GrassCoverErosionInwards.IO.Test.csproj) (revision 3d84064b23186da3fb11f19ff0d07f41e1209bbb) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/Ringtoets.GrassCoverErosionInwards.IO.Test.csproj (.../Ringtoets.GrassCoverErosionInwards.IO.Test.csproj) (revision 0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5) @@ -37,14 +37,6 @@ none - - False - ..\..\..\..\lib\DotSpatial.1.8\DotSpatial.Data.dll - - - False - ..\..\..\..\lib\DotSpatial.1.8\DotSpatial.Topology.dll - ..\..\..\..\packages\NUnit.2.6.4\lib\nunit.framework.dll True Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Integration.Test/GrassCoverErosionInwardsCalculationServiceIntegrationTest.cs =================================================================== diff -u -rc34c2e384cd7dae5371fb5d827ac26cb66e70cfe -r0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Integration.Test/GrassCoverErosionInwardsCalculationServiceIntegrationTest.cs (.../GrassCoverErosionInwardsCalculationServiceIntegrationTest.cs) (revision c34c2e384cd7dae5371fb5d827ac26cb66e70cfe) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Integration.Test/GrassCoverErosionInwardsCalculationServiceIntegrationTest.cs (.../GrassCoverErosionInwardsCalculationServiceIntegrationTest.cs) (revision 0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5) @@ -22,12 +22,9 @@ using System; using System.IO; using System.Linq; - using Core.Common.Base.Geometry; using Core.Common.TestUtil; - using NUnit.Framework; - using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.Common.Data.FailureMechanism; using Ringtoets.GrassCoverErosionInwards.Data; @@ -211,10 +208,10 @@ // Call GrassCoverErosionInwardsCalculationServiceOutput output = GrassCoverErosionInwardsCalculationService.CalculateProbability(calculation, - testDataPath, - failureMechanismSection, - failureMechanismSection.Name, - assessmentSection.GrassCoverErosionInwards.GeneralInput); + testDataPath, + failureMechanismSection, + failureMechanismSection.Name, + assessmentSection.GrassCoverErosionInwards.GeneralInput); // Assert Assert.IsNotNull(output); Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Integration.Test/IntegrationTestHelper.cs =================================================================== diff -u -r766487194eab00bc9205f5cd29f269c9af5f2ab8 -r0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Integration.Test/IntegrationTestHelper.cs (.../IntegrationTestHelper.cs) (revision 766487194eab00bc9205f5cd29f269c9af5f2ab8) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Integration.Test/IntegrationTestHelper.cs (.../IntegrationTestHelper.cs) (revision 0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5) @@ -49,7 +49,7 @@ "traject_6-3.shx")) { var activity = new FileImportActivity(new ReferenceLineImporter(), - new ReferenceLineContext(assessmentSection), + new ReferenceLineContext(assessmentSection), Path.Combine(embeddedResourceFileWriter.TargetFolderPath, "traject_6-3.shp")); activity.Run(); Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/FileImporter/DikeProfilesImporterTest.cs =================================================================== diff -u -r718348fd1a88ab775f495dad750379e4cbedb25f -r0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/FileImporter/DikeProfilesImporterTest.cs (.../DikeProfilesImporterTest.cs) (revision 718348fd1a88ab775f495dad750379e4cbedb25f) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/FileImporter/DikeProfilesImporterTest.cs (.../DikeProfilesImporterTest.cs) (revision 0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5) @@ -904,7 +904,8 @@ private ReferenceLine CreateMatchingReferenceLine() { var referenceLine = new ReferenceLine(); - referenceLine.SetGeometry(new[] { + referenceLine.SetGeometry(new[] + { new Point2D(131223.2, 548393.4), new Point2D(133854.3, 545323.1), new Point2D(135561.0, 541920.3), Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/ViewInfos/GrassCoverErosionInwardsFailureMechanismResultViewInfoTest.cs =================================================================== diff -u -ra1ec5faebf7ccf8e67fa34a2b73cd1063ab48840 -r0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/ViewInfos/GrassCoverErosionInwardsFailureMechanismResultViewInfoTest.cs (.../GrassCoverErosionInwardsFailureMechanismResultViewInfoTest.cs) (revision a1ec5faebf7ccf8e67fa34a2b73cd1063ab48840) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/ViewInfos/GrassCoverErosionInwardsFailureMechanismResultViewInfoTest.cs (.../GrassCoverErosionInwardsFailureMechanismResultViewInfoTest.cs) (revision 0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5) @@ -141,7 +141,7 @@ assessmentSectionMock.Expect(asm => asm.GetFailureMechanisms()).Return(new[] { - new GrassCoverErosionInwardsFailureMechanism() + new GrassCoverErosionInwardsFailureMechanism() }); mocks.ReplayAll(); @@ -296,4 +296,4 @@ }); } } -} +} \ No newline at end of file Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/ViewInfos/GrassCoverErosionInwardsInputViewInfoTest.cs =================================================================== diff -u -ra1ec5faebf7ccf8e67fa34a2b73cd1063ab48840 -r0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/ViewInfos/GrassCoverErosionInwardsInputViewInfoTest.cs (.../GrassCoverErosionInwardsInputViewInfoTest.cs) (revision a1ec5faebf7ccf8e67fa34a2b73cd1063ab48840) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/ViewInfos/GrassCoverErosionInwardsInputViewInfoTest.cs (.../GrassCoverErosionInwardsInputViewInfoTest.cs) (revision 0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5) @@ -30,7 +30,6 @@ using Ringtoets.GrassCoverErosionInwards.Forms.PresentationObjects; using Ringtoets.GrassCoverErosionInwards.Forms.Properties; using Ringtoets.GrassCoverErosionInwards.Forms.Views; - using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources; namespace Ringtoets.GrassCoverErosionInwards.Plugin.Test.ViewInfos @@ -111,8 +110,8 @@ GrassCoverErosionInwardsCalculation calculation = new GrassCoverErosionInwardsCalculation(); GrassCoverErosionInwardsCalculationContext calculationContext = new GrassCoverErosionInwardsCalculationContext(calculation, - new GrassCoverErosionInwardsFailureMechanism(), - assessmentSection); + new GrassCoverErosionInwardsFailureMechanism(), + assessmentSection); using (GrassCoverErosionInwardsInputView view = new GrassCoverErosionInwardsInputView { @@ -139,8 +138,8 @@ GrassCoverErosionInwardsCalculation calculationToRemove = new GrassCoverErosionInwardsCalculation(); GrassCoverErosionInwardsCalculationContext calculationContext = new GrassCoverErosionInwardsCalculationContext(calculationToRemove, - new GrassCoverErosionInwardsFailureMechanism(), - assessmentSection); + new GrassCoverErosionInwardsFailureMechanism(), + assessmentSection); using (GrassCoverErosionInwardsInputView view = new GrassCoverErosionInwardsInputView { @@ -168,8 +167,8 @@ calculationGroup.Children.Add(calculation); GrassCoverErosionInwardsCalculationGroupContext calculationGroupContext = new GrassCoverErosionInwardsCalculationGroupContext(calculationGroup, - new GrassCoverErosionInwardsFailureMechanism(), - assessmentSection); + new GrassCoverErosionInwardsFailureMechanism(), + assessmentSection); using (GrassCoverErosionInwardsInputView view = new GrassCoverErosionInwardsInputView { Data = calculation @@ -196,8 +195,8 @@ calculationGroup.Children.Add(calculation); GrassCoverErosionInwardsCalculationGroupContext calculationGroupContext = new GrassCoverErosionInwardsCalculationGroupContext(new CalculationGroup(), - new GrassCoverErosionInwardsFailureMechanism(), - assessmentSection); + new GrassCoverErosionInwardsFailureMechanism(), + assessmentSection); using (GrassCoverErosionInwardsInputView view = new GrassCoverErosionInwardsInputView { Data = calculation @@ -226,8 +225,8 @@ calculationGroup.Children.Add(nestedGroup); GrassCoverErosionInwardsCalculationGroupContext calculationGroupContext = new GrassCoverErosionInwardsCalculationGroupContext(calculationGroup, - new GrassCoverErosionInwardsFailureMechanism(), - assessmentSection); + new GrassCoverErosionInwardsFailureMechanism(), + assessmentSection); using (GrassCoverErosionInwardsInputView view = new GrassCoverErosionInwardsInputView { Data = calculation @@ -256,8 +255,8 @@ calculationGroup.Children.Add(nestedGroup); GrassCoverErosionInwardsCalculationGroupContext calculationGroupContext = new GrassCoverErosionInwardsCalculationGroupContext(new CalculationGroup(), - new GrassCoverErosionInwardsFailureMechanism(), - assessmentSection); + new GrassCoverErosionInwardsFailureMechanism(), + assessmentSection); using (GrassCoverErosionInwardsInputView view = new GrassCoverErosionInwardsInputView { Data = calculation @@ -385,7 +384,7 @@ mocks.VerifyAll(); } } - + [Test] public void CloseForData_ViewCorrespondingToRemovedFailureMechanism_ReturnsTrue() { @@ -602,4 +601,4 @@ } } } -} +} \ No newline at end of file Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/ViewInfos/GrassCoverErosionInwardsScenariosViewInfoTest.cs =================================================================== diff -u -re3f9dffa91a0def0b6e6bc7dfabef74cc64745c5 -r0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/ViewInfos/GrassCoverErosionInwardsScenariosViewInfoTest.cs (.../GrassCoverErosionInwardsScenariosViewInfoTest.cs) (revision e3f9dffa91a0def0b6e6bc7dfabef74cc64745c5) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/ViewInfos/GrassCoverErosionInwardsScenariosViewInfoTest.cs (.../GrassCoverErosionInwardsScenariosViewInfoTest.cs) (revision 0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5) @@ -21,14 +21,10 @@ using System.Drawing; using System.Linq; - using Core.Common.Gui.Plugin; using Core.Common.TestUtil; - using NUnit.Framework; - using Rhino.Mocks; - using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.Common.Data.Calculation; using Ringtoets.Common.Data.FailureMechanism; Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Service.Test/Ringtoets.GrassCoverErosionInwards.Service.Test.csproj =================================================================== diff -u -r3d84064b23186da3fb11f19ff0d07f41e1209bbb -r0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Service.Test/Ringtoets.GrassCoverErosionInwards.Service.Test.csproj (.../Ringtoets.GrassCoverErosionInwards.Service.Test.csproj) (revision 3d84064b23186da3fb11f19ff0d07f41e1209bbb) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Service.Test/Ringtoets.GrassCoverErosionInwards.Service.Test.csproj (.../Ringtoets.GrassCoverErosionInwards.Service.Test.csproj) (revision 0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5) @@ -67,10 +67,6 @@ {3bbfd65b-b277-4e50-ae6d-bd24c3434609} Core.Common.Base - - {D749EE4C-CE50-4C17-BF01-9A953028C126} - Core.Common.TestUtil - {d4200f43-3f72-4f42-af0a-8ced416a38ec} Ringtoets.Common.Data @@ -79,10 +75,6 @@ {888d4097-8bc2-4703-9fb1-8744c94d525e} Ringtoets.HydraRing.Calculation - - {70F8CC9C-5BC8-4FB2-B201-EAE7FA8088C2} - Ringtoets.HydraRing.Data - {90DE728E-48EF-4665-AB38-3D88E41D9F4D} Ringtoets.GrassCoverErosionInwards.Data Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Utils.Test/AssignUnassignCalculationsTest.cs =================================================================== diff -u -r3d83d16a31cb6fdc70e7b0e2c0e7f7915bcaa465 -r0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Utils.Test/AssignUnassignCalculationsTest.cs (.../AssignUnassignCalculationsTest.cs) (revision 3d83d16a31cb6fdc70e7b0e2c0e7f7915bcaa465) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Utils.Test/AssignUnassignCalculationsTest.cs (.../AssignUnassignCalculationsTest.cs) (revision 0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5) @@ -162,7 +162,7 @@ Assert.IsNull(sectionResults[0].Calculation); Assert.AreSame(calculation2, sectionResults[1].Calculation); } - + [Test] public void Delete_NullSectionResults_ThrowsArgumentNullException() { @@ -198,7 +198,7 @@ var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); // Call - TestDelegate call = () => AssignUnassignCalculations.Delete(failureMechanism.SectionResults, new GrassCoverErosionInwardsCalculation(), null); + TestDelegate call = () => AssignUnassignCalculations.Delete(failureMechanism.SectionResults, new GrassCoverErosionInwardsCalculation(), null); // Assert string paramName = Assert.Throws(call).ParamName; Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Utils.Test/GrassCoverErosionInwardsDataSynchronizationServiceTest.cs =================================================================== diff -u -rf7b5ed585321bbc2249ec9c8ecd8af7f9eb1808a -r0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Utils.Test/GrassCoverErosionInwardsDataSynchronizationServiceTest.cs (.../GrassCoverErosionInwardsDataSynchronizationServiceTest.cs) (revision f7b5ed585321bbc2249ec9c8ecd8af7f9eb1808a) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Utils.Test/GrassCoverErosionInwardsDataSynchronizationServiceTest.cs (.../GrassCoverErosionInwardsDataSynchronizationServiceTest.cs) (revision 0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5) @@ -73,7 +73,11 @@ { Assert.IsNull(calculation.Output); } - CollectionAssert.AreEqual(new[] { calculation1, calculation2 }, affectedItems); + CollectionAssert.AreEqual(new[] + { + calculation1, + calculation2 + }, affectedItems); } [Test] Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Utils.Test/GrassCoverErosionInwardsHelperTest.cs =================================================================== diff -u -r53aef346fd0ee3cc79d1f5df9171c476453f2935 -r0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Utils.Test/GrassCoverErosionInwardsHelperTest.cs (.../GrassCoverErosionInwardsHelperTest.cs) (revision 53aef346fd0ee3cc79d1f5df9171c476453f2935) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Utils.Test/GrassCoverErosionInwardsHelperTest.cs (.../GrassCoverErosionInwardsHelperTest.cs) (revision 0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5) @@ -31,6 +31,51 @@ [TestFixture] public class GrassCoverErosionInwardsHelperTest { + private readonly GrassCoverErosionInwardsFailureMechanismSectionResult[] oneSectionResult = + { + new GrassCoverErosionInwardsFailureMechanismSectionResult( + new FailureMechanismSection("testFailureMechanismSection", new List + { + new Point2D(0.0, 0.0) + })) + }; + + private readonly GrassCoverErosionInwardsFailureMechanismSectionResult[] twoSectionResults = + { + new GrassCoverErosionInwardsFailureMechanismSectionResult( + new FailureMechanismSection(firstSectionName, new List + { + new Point2D(0.0, 0.0), + new Point2D(10.0, 10.0), + })), + new GrassCoverErosionInwardsFailureMechanismSectionResult( + new FailureMechanismSection(secondSectionName, new List + { + new Point2D(11.0, 11.0), + new Point2D(100.0, 100.0), + })) + }; + + private readonly GrassCoverErosionInwardsCalculation[] twoCalculations = + { + new GrassCoverErosionInwardsCalculation + { + InputParameters = + { + DikeProfile = new DikeProfile(new Point2D(1.1, 2.2), new RoughnessPoint[0], new Point2D[0], + null, new DikeProfile.ConstructionProperties()) + } + }, + new GrassCoverErosionInwardsCalculation + { + InputParameters = + { + DikeProfile = new DikeProfile(new Point2D(3.3, 4.4), new RoughnessPoint[0], new Point2D[0], + null, new DikeProfile.ConstructionProperties()) + } + } + }; + [Test] public void CollectCalculationsPerSegment_SectionResultsNull_ThrowsArgumentNullException() { @@ -63,7 +108,7 @@ var emptySectionResults = new GrassCoverErosionInwardsFailureMechanismSectionResult[0]; // Call - Dictionary> collectCalculationsPerSegment = + Dictionary> collectCalculationsPerSegment = GrassCoverErosionInwardsHelper.CollectCalculationsPerSegment(emptySectionResults, twoCalculations); // Assert @@ -77,7 +122,7 @@ var calculations = new GrassCoverErosionInwardsCalculation[0]; // Call - Dictionary> collectCalculationsPerSegment = + Dictionary> collectCalculationsPerSegment = GrassCoverErosionInwardsHelper.CollectCalculationsPerSegment(oneSectionResult, calculations); // Assert @@ -88,13 +133,14 @@ public void CollectCalculationsPerSegment_CalculationsWithoutDikeProfiles_EmptyDictionary() { // Setup - GrassCoverErosionInwardsCalculation[] calculations = { + GrassCoverErosionInwardsCalculation[] calculations = + { new GrassCoverErosionInwardsCalculation(), new GrassCoverErosionInwardsCalculation() }; // Call - Dictionary> collectCalculationsPerSegment = + Dictionary> collectCalculationsPerSegment = GrassCoverErosionInwardsHelper.CollectCalculationsPerSegment(oneSectionResult, calculations); // Assert @@ -105,7 +151,7 @@ public void CollectCalculationsPerSegment_MultipleCalculationsInSegment_OneSegmentHasAllCalculations() { // Call - Dictionary> collectCalculationsPerSegment = + Dictionary> collectCalculationsPerSegment = GrassCoverErosionInwardsHelper.CollectCalculationsPerSegment(twoSectionResults, twoCalculations); // Assert @@ -139,7 +185,7 @@ }; // Call - Dictionary> collectCalculationsPerSegment = + Dictionary> collectCalculationsPerSegment = GrassCoverErosionInwardsHelper.CollectCalculationsPerSegment(twoSectionResults, calculations); // Assert @@ -192,7 +238,7 @@ var calculation = new GrassCoverErosionInwardsCalculation(); // Call - FailureMechanismSection failureMechanismSection = + FailureMechanismSection failureMechanismSection = GrassCoverErosionInwardsHelper.FailureMechanismSectionForCalculation(oneSectionResult, calculation); // Assert @@ -206,7 +252,7 @@ var calculation = new GrassCoverErosionInwardsCalculation(); // Call - FailureMechanismSection failureMechanismSection = + FailureMechanismSection failureMechanismSection = GrassCoverErosionInwardsHelper.FailureMechanismSectionForCalculation(oneSectionResult, calculation); // Assert @@ -221,7 +267,7 @@ var calculation = new GrassCoverErosionInwardsCalculation(); // Call - FailureMechanismSection failureMechanismSection = + FailureMechanismSection failureMechanismSection = GrassCoverErosionInwardsHelper.FailureMechanismSectionForCalculation(emptySectionResults, calculation); // Assert @@ -242,7 +288,7 @@ }; // Call - FailureMechanismSection failureMechanismSection = + FailureMechanismSection failureMechanismSection = GrassCoverErosionInwardsHelper.FailureMechanismSectionForCalculation(twoSectionResults, calculation); // Assert @@ -263,7 +309,7 @@ }; // Call - FailureMechanismSection failureMechanismSection = + FailureMechanismSection failureMechanismSection = GrassCoverErosionInwardsHelper.FailureMechanismSectionForCalculation(twoSectionResults, calculation); // Assert @@ -272,48 +318,5 @@ private const string firstSectionName = "firstSection"; private const string secondSectionName = "secondSection"; - - private readonly GrassCoverErosionInwardsFailureMechanismSectionResult[] oneSectionResult = { - new GrassCoverErosionInwardsFailureMechanismSectionResult( - new FailureMechanismSection("testFailureMechanismSection", new List - { - new Point2D(0.0, 0.0) - })) - }; - - private readonly GrassCoverErosionInwardsFailureMechanismSectionResult[] twoSectionResults = { - new GrassCoverErosionInwardsFailureMechanismSectionResult( - new FailureMechanismSection(firstSectionName, new List - { - new Point2D(0.0, 0.0), - new Point2D(10.0, 10.0), - })), - new GrassCoverErosionInwardsFailureMechanismSectionResult( - new FailureMechanismSection(secondSectionName, new List - { - new Point2D(11.0, 11.0), - new Point2D(100.0, 100.0), - })) - }; - - private readonly GrassCoverErosionInwardsCalculation[] twoCalculations = - { - new GrassCoverErosionInwardsCalculation - { - InputParameters = - { - DikeProfile = new DikeProfile(new Point2D(1.1, 2.2), new RoughnessPoint[0], new Point2D[0], - null, new DikeProfile.ConstructionProperties()) - } - }, - new GrassCoverErosionInwardsCalculation - { - InputParameters = - { - DikeProfile = new DikeProfile(new Point2D(3.3, 4.4), new RoughnessPoint[0], new Point2D[0], - null, new DikeProfile.ConstructionProperties()) - } - } - }; } } \ No newline at end of file