Fisheye: Tag 69c1988e3c492c44148e112151efb3c04a853fcc refers to a dead (removed) revision in file `Ringtoets/Common/src/Ringtoets.Common.IO/BreakWaterTypeConverter.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Ringtoets/Common/src/Ringtoets.Common.IO/Readers/ReadBreakWaterType.cs
===================================================================
diff -u
--- Ringtoets/Common/src/Ringtoets.Common.IO/Readers/ReadBreakWaterType.cs (revision 0)
+++ Ringtoets/Common/src/Ringtoets.Common.IO/Readers/ReadBreakWaterType.cs (revision 69c1988e3c492c44148e112151efb3c04a853fcc)
@@ -0,0 +1,44 @@
+// 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.
+
+namespace Ringtoets.Common.IO.Readers
+{
+ ///
+ /// Defines the various types of break water values possible in a read calculation configuration.
+ ///
+ public enum ReadBreakWaterType
+ {
+ ///
+ /// A wall.
+ ///
+ Wall = 1,
+
+ ///
+ /// A watertight retaining structure.
+ ///
+ Caisson = 2,
+
+ ///
+ /// A barrier that impounds water or underground streams.
+ ///
+ Dam = 3
+ }
+}
\ No newline at end of file
Index: Ringtoets/Common/src/Ringtoets.Common.IO/Readers/ReadBreakWaterTypeConverter.cs
===================================================================
diff -u
--- Ringtoets/Common/src/Ringtoets.Common.IO/Readers/ReadBreakWaterTypeConverter.cs (revision 0)
+++ Ringtoets/Common/src/Ringtoets.Common.IO/Readers/ReadBreakWaterTypeConverter.cs (revision 69c1988e3c492c44148e112151efb3c04a853fcc)
@@ -0,0 +1,81 @@
+// 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 Ringtoets.Common.IO.Schema;
+
+namespace Ringtoets.Common.IO.Readers
+{
+ ///
+ /// Converts to and back.
+ ///
+ public class ReadBreakWaterTypeConverter : TypeConverter
+ {
+ public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
+ {
+ if (destinationType == typeof(string))
+ {
+ var type = (ReadBreakWaterType) value;
+ switch (type)
+ {
+ case ReadBreakWaterType.Caisson:
+ return ConfigurationSchemaIdentifiers.BreakWaterCaisson;
+ case ReadBreakWaterType.Dam:
+ return ConfigurationSchemaIdentifiers.BreakWaterDam;
+ case ReadBreakWaterType.Wall:
+ return ConfigurationSchemaIdentifiers.BreakWaterWall;
+ default:
+ throw new NotSupportedException();
+ }
+ }
+ return base.ConvertTo(context, culture, value, destinationType);
+ }
+
+ public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
+ {
+ if (sourceType == typeof(string))
+ {
+ return true;
+ }
+ return base.CanConvertFrom(context, sourceType);
+ }
+
+ public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
+ {
+ var text = value as string;
+ if (text != null)
+ {
+ switch (text)
+ {
+ case ConfigurationSchemaIdentifiers.BreakWaterCaisson:
+ return ReadBreakWaterType.Caisson;
+ case ConfigurationSchemaIdentifiers.BreakWaterDam:
+ return ReadBreakWaterType.Dam;
+ case ConfigurationSchemaIdentifiers.BreakWaterWall:
+ return ReadBreakWaterType.Wall;
+ }
+ }
+ return base.ConvertFrom(context, culture, value);
+ }
+ }
+}
\ No newline at end of file
Index: Ringtoets/Common/src/Ringtoets.Common.IO/Ringtoets.Common.IO.csproj
===================================================================
diff -u -r236569ca4c1124cdd32203da577aa4156eb4020e -r69c1988e3c492c44148e112151efb3c04a853fcc
--- Ringtoets/Common/src/Ringtoets.Common.IO/Ringtoets.Common.IO.csproj (.../Ringtoets.Common.IO.csproj) (revision 236569ca4c1124cdd32203da577aa4156eb4020e)
+++ Ringtoets/Common/src/Ringtoets.Common.IO/Ringtoets.Common.IO.csproj (.../Ringtoets.Common.IO.csproj) (revision 69c1988e3c492c44148e112151efb3c04a853fcc)
@@ -54,7 +54,7 @@
-
+
@@ -83,6 +83,7 @@
+
Index: Ringtoets/Common/src/Ringtoets.Common.IO/Writers/CalculationConfigurationWriter.cs
===================================================================
diff -u -rabec4a29ec825871c4beeff61b27677cfe3c64b4 -r69c1988e3c492c44148e112151efb3c04a853fcc
--- Ringtoets/Common/src/Ringtoets.Common.IO/Writers/CalculationConfigurationWriter.cs (.../CalculationConfigurationWriter.cs) (revision abec4a29ec825871c4beeff61b27677cfe3c64b4)
+++ Ringtoets/Common/src/Ringtoets.Common.IO/Writers/CalculationConfigurationWriter.cs (.../CalculationConfigurationWriter.cs) (revision 69c1988e3c492c44148e112151efb3c04a853fcc)
@@ -27,6 +27,7 @@
using Ringtoets.Common.Data.Calculation;
using Ringtoets.Common.Data.DikeProfiles;
using Ringtoets.Common.Data.Probabilistics;
+using Ringtoets.Common.IO.Readers;
using Ringtoets.Common.IO.Schema;
namespace Ringtoets.Common.IO.Writers
@@ -127,7 +128,7 @@
{
writer.WriteElementString(
ConfigurationSchemaIdentifiers.BreakWaterType,
- BreakWaterTypeAsXmlString(breakWater.Type));
+ BreakWaterTypeAsXmlString((ReadBreakWaterType) breakWater.Type));
writer.WriteElementString(
ConfigurationSchemaIdentifiers.BreakWaterHeight,
XmlConvert.ToString(breakWater.Height));
@@ -164,9 +165,9 @@
}
}
- private static string BreakWaterTypeAsXmlString(BreakWaterType type)
+ private static string BreakWaterTypeAsXmlString(ReadBreakWaterType type)
{
- return new BreakWaterTypeConverter().ConvertToInvariantString(type);
+ return new ReadBreakWaterTypeConverter().ConvertToInvariantString(type);
}
private static void WriteDistribution(IDistribution distribution, string elementName, XmlWriter writer)
Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/BreakWaterTypeConverterTest.cs
===================================================================
diff -u -r09fb591f0e8017e22b62ca554f6eceeeafa51219 -r69c1988e3c492c44148e112151efb3c04a853fcc
--- Ringtoets/Common/test/Ringtoets.Common.IO.Test/BreakWaterTypeConverterTest.cs (.../BreakWaterTypeConverterTest.cs) (revision 09fb591f0e8017e22b62ca554f6eceeeafa51219)
+++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/BreakWaterTypeConverterTest.cs (.../BreakWaterTypeConverterTest.cs) (revision 69c1988e3c492c44148e112151efb3c04a853fcc)
@@ -22,7 +22,7 @@
using System;
using System.ComponentModel;
using NUnit.Framework;
-using Ringtoets.Common.Data.DikeProfiles;
+using Ringtoets.Common.IO.Readers;
using Ringtoets.Common.IO.Schema;
namespace Ringtoets.Common.IO.Test
@@ -34,7 +34,7 @@
public void Constructor_ExpectedValues()
{
// Call
- var converter = new BreakWaterTypeConverter();
+ var converter = new ReadBreakWaterTypeConverter();
// Assert
Assert.IsInstanceOf(converter);
@@ -44,7 +44,7 @@
public void CanConvertTo_String_ReturnTrue()
{
// Setup
- var converter = new BreakWaterTypeConverter();
+ var converter = new ReadBreakWaterTypeConverter();
// Call
bool canConvertToString = converter.CanConvertTo(typeof(string));
@@ -57,7 +57,7 @@
public void CanConvertTo_OtherThanString_ReturnFalse()
{
// Setup
- var converter = new BreakWaterTypeConverter();
+ var converter = new ReadBreakWaterTypeConverter();
// Call
bool canConvertToString = converter.CanConvertTo(typeof(object));
@@ -67,14 +67,14 @@
}
[Test]
- [TestCase(BreakWaterType.Caisson, ConfigurationSchemaIdentifiers.BreakWaterCaisson)]
- [TestCase(BreakWaterType.Dam, ConfigurationSchemaIdentifiers.BreakWaterDam)]
- [TestCase(BreakWaterType.Wall, ConfigurationSchemaIdentifiers.BreakWaterWall)]
- public void ConverTo_VariousCases_ReturnExpectedText(BreakWaterType value,
+ [TestCase(ReadBreakWaterType.Caisson, ConfigurationSchemaIdentifiers.BreakWaterCaisson)]
+ [TestCase(ReadBreakWaterType.Dam, ConfigurationSchemaIdentifiers.BreakWaterDam)]
+ [TestCase(ReadBreakWaterType.Wall, ConfigurationSchemaIdentifiers.BreakWaterWall)]
+ public void ConverTo_VariousCases_ReturnExpectedText(ReadBreakWaterType value,
string expectedResult)
{
// Setup
- var converter = new BreakWaterTypeConverter();
+ var converter = new ReadBreakWaterTypeConverter();
// Call
object result = converter.ConvertTo(value, typeof(string));
@@ -87,8 +87,8 @@
public void ConvertTo_InvalidBreakWaterType_ThrowNotSupportedException()
{
// Setup
- var converter = new BreakWaterTypeConverter();
- var invalidValue = (BreakWaterType) 99999999;
+ var converter = new ReadBreakWaterTypeConverter();
+ var invalidValue = (ReadBreakWaterType) 99999999;
// Call
TestDelegate call = () => converter.ConvertTo(invalidValue, typeof(string));
@@ -101,7 +101,7 @@
public void CanConvertFrom_String_ReturnTrue()
{
// Setup
- var converter = new BreakWaterTypeConverter();
+ var converter = new ReadBreakWaterTypeConverter();
// Call
bool canConvertFromString = converter.CanConvertFrom(typeof(string));
@@ -114,7 +114,7 @@
public void CanConvertFrom_OtherThanString_ReturnFalse()
{
// Setup
- var converter = new BreakWaterTypeConverter();
+ var converter = new ReadBreakWaterTypeConverter();
// Call
bool canConvertFromString = converter.CanConvertFrom(typeof(object));
@@ -124,14 +124,14 @@
}
[Test]
- [TestCase(ConfigurationSchemaIdentifiers.BreakWaterCaisson, BreakWaterType.Caisson)]
- [TestCase(ConfigurationSchemaIdentifiers.BreakWaterDam, BreakWaterType.Dam)]
- [TestCase(ConfigurationSchemaIdentifiers.BreakWaterWall, BreakWaterType.Wall)]
+ [TestCase(ConfigurationSchemaIdentifiers.BreakWaterCaisson, ReadBreakWaterType.Caisson)]
+ [TestCase(ConfigurationSchemaIdentifiers.BreakWaterDam, ReadBreakWaterType.Dam)]
+ [TestCase(ConfigurationSchemaIdentifiers.BreakWaterWall, ReadBreakWaterType.Wall)]
public void ConvertFrom_Text_ReturnExpectedBreakWaterType(string value,
- BreakWaterType expectedResult)
+ ReadBreakWaterType expectedResult)
{
// Setup
- var converter = new BreakWaterTypeConverter();
+ var converter = new ReadBreakWaterTypeConverter();
// Call
object result = converter.ConvertFrom(value);
@@ -144,7 +144,7 @@
public void ConvertFrom_InvalidText_ThrowNotSupportedException()
{
// Setup
- var converter = new BreakWaterTypeConverter();
+ var converter = new ReadBreakWaterTypeConverter();
// Call
TestDelegate call = () => converter.ConvertFrom("A");
Fisheye: Tag 69c1988e3c492c44148e112151efb3c04a853fcc refers to a dead (removed) revision in file `Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.IO/DikeHeightCalculationTypeConverter.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.IO/Importers/GrassCoverErosionInwardsCalculationConfigurationImporter.cs
===================================================================
diff -u -rae6ef0985e7b64acca060b6782e21a3446548366 -r69c1988e3c492c44148e112151efb3c04a853fcc
--- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.IO/Importers/GrassCoverErosionInwardsCalculationConfigurationImporter.cs (.../GrassCoverErosionInwardsCalculationConfigurationImporter.cs) (revision ae6ef0985e7b64acca060b6782e21a3446548366)
+++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.IO/Importers/GrassCoverErosionInwardsCalculationConfigurationImporter.cs (.../GrassCoverErosionInwardsCalculationConfigurationImporter.cs) (revision 69c1988e3c492c44148e112151efb3c04a853fcc)
@@ -224,7 +224,7 @@
if (readCalculation.BreakWaterType != null)
{
- calculation.InputParameters.BreakWater.Type = readCalculation.BreakWaterType.Value;
+ calculation.InputParameters.BreakWater.Type = (BreakWaterType) readCalculation.BreakWaterType.Value;
}
if (readCalculation.BreakWaterHeight.HasValue)
@@ -270,7 +270,7 @@
{
if (readCalculation.DikeHeightCalculationType.HasValue)
{
- calculation.InputParameters.DikeHeightCalculationType = readCalculation.DikeHeightCalculationType.Value;
+ calculation.InputParameters.DikeHeightCalculationType = (DikeHeightCalculationType) readCalculation.DikeHeightCalculationType.Value;
}
}
Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.IO/Properties/Resources.Designer.cs
===================================================================
diff -u -r1144837cd4defc65250e08e83d9ab8583324e21b -r69c1988e3c492c44148e112151efb3c04a853fcc
--- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.IO/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 1144837cd4defc65250e08e83d9ab8583324e21b)
+++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.IO/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 69c1988e3c492c44148e112151efb3c04a853fcc)
@@ -82,33 +82,6 @@
}
///
- /// Looks up a localized string similar to norm.
- ///
- internal static string DikeHeightCalculationTypeConverter_CalculateByAssessmentSectionNorm {
- get {
- return ResourceManager.GetString("DikeHeightCalculationTypeConverter_CalculateByAssessmentSectionNorm", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to doorsnede.
- ///
- internal static string DikeHeightCalculationTypeConverter_CalculateByProfileSpecificRequiredProbability {
- get {
- return ResourceManager.GetString("DikeHeightCalculationTypeConverter_CalculateByProfileSpecificRequiredProbability", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to niet.
- ///
- internal static string DikeHeightCalculationTypeConverter_NoCalculation {
- get {
- return ResourceManager.GetString("DikeHeightCalculationTypeConverter_NoCalculation", resourceCulture);
- }
- }
-
- ///
/// Looks up a localized string similar to <?xml version="1.0" encoding="UTF-8"?>
///
///<!--
@@ -179,5 +152,33 @@
"_DikeProfile_provided_for_DikeHeight", resourceCulture);
}
}
+
+ ///
+ /// Looks up a localized string similar to norm.
+ ///
+ internal static string ReadDikeHeightCalculationTypeConverter_CalculateByAssessmentSectionNorm {
+ get {
+ return ResourceManager.GetString("ReadDikeHeightCalculationTypeConverter_CalculateByAssessmentSectionNorm", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to doorsnede.
+ ///
+ internal static string ReadDikeHeightCalculationTypeConverter_CalculateByProfileSpecificRequiredProbability {
+ get {
+ return ResourceManager.GetString("ReadDikeHeightCalculationTypeConverter_CalculateByProfileSpecificRequiredProbabil" +
+ "ity", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to niet.
+ ///
+ internal static string ReadDikeHeightCalculationTypeConverter_NoCalculation {
+ get {
+ return ResourceManager.GetString("ReadDikeHeightCalculationTypeConverter_NoCalculation", resourceCulture);
+ }
+ }
}
}
Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.IO/Properties/Resources.resx
===================================================================
diff -u -r1144837cd4defc65250e08e83d9ab8583324e21b -r69c1988e3c492c44148e112151efb3c04a853fcc
--- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.IO/Properties/Resources.resx (.../Resources.resx) (revision 1144837cd4defc65250e08e83d9ab8583324e21b)
+++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.IO/Properties/Resources.resx (.../Resources.resx) (revision 69c1988e3c492c44148e112151efb3c04a853fcc)
@@ -121,13 +121,13 @@
..\Resources\GEKBConfiguratieSchema.xsd;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252
-
+
niet
-
+
norm
-
+
doorsnede
Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.IO/Readers/GrassCoverErosionInwardsCalculationConfigurationReader.cs
===================================================================
diff -u -ra5c5133ec23681679e77ff31b89e6410d366f247 -r69c1988e3c492c44148e112151efb3c04a853fcc
--- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.IO/Readers/GrassCoverErosionInwardsCalculationConfigurationReader.cs (.../GrassCoverErosionInwardsCalculationConfigurationReader.cs) (revision a5c5133ec23681679e77ff31b89e6410d366f247)
+++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.IO/Readers/GrassCoverErosionInwardsCalculationConfigurationReader.cs (.../GrassCoverErosionInwardsCalculationConfigurationReader.cs) (revision 69c1988e3c492c44148e112151efb3c04a853fcc)
@@ -23,11 +23,9 @@
using System.Collections.Generic;
using System.Xml.Linq;
using Core.Common.Base.IO;
-using Ringtoets.Common.Data.DikeProfiles;
using Ringtoets.Common.IO;
using Ringtoets.Common.IO.Readers;
using Ringtoets.Common.IO.Schema;
-using Ringtoets.GrassCoverErosionInwards.Data;
using Ringtoets.GrassCoverErosionInwards.IO.Properties;
using RingtoetsCommonIOResources = Ringtoets.Common.IO.Properties.Resources;
@@ -81,10 +79,10 @@
DikeProfile = calculationElement.GetStringValueFromDescendantElement(GrassCoverErosionInwardsCalculationConfigurationSchemaIdentifiers.DikeProfileElement),
Orientation = calculationElement.GetDoubleValueFromDescendantElement(ConfigurationSchemaIdentifiers.Orientation),
DikeHeight = calculationElement.GetDoubleValueFromDescendantElement(GrassCoverErosionInwardsCalculationConfigurationSchemaIdentifiers.DikeHeightElement),
- DikeHeightCalculationType = (DikeHeightCalculationType?) calculationElement.GetConvertedValueFromDescendantElement(
+ DikeHeightCalculationType = (ReadDikeHeightCalculationType?) calculationElement.GetConvertedValueFromDescendantElement(
GrassCoverErosionInwardsCalculationConfigurationSchemaIdentifiers.DikeHeightCalculationTypeElement),
UseBreakWater = calculationElement.GetBoolValueFromDescendantElement(ConfigurationSchemaIdentifiers.UseBreakWater),
- BreakWaterType = (BreakWaterType?) calculationElement.GetConvertedValueFromDescendantElement(ConfigurationSchemaIdentifiers.BreakWaterType),
+ BreakWaterType = (ReadBreakWaterType?) calculationElement.GetConvertedValueFromDescendantElement(ConfigurationSchemaIdentifiers.BreakWaterType),
BreakWaterHeight = calculationElement.GetDoubleValueFromDescendantElement(ConfigurationSchemaIdentifiers.BreakWaterHeight),
UseForeshore = calculationElement.GetBoolValueFromDescendantElement(ConfigurationSchemaIdentifiers.UseForeshore)
};
Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.IO/Readers/ReadDikeHeightCalculationType.cs
===================================================================
diff -u
--- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.IO/Readers/ReadDikeHeightCalculationType.cs (revision 0)
+++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.IO/Readers/ReadDikeHeightCalculationType.cs (revision 69c1988e3c492c44148e112151efb3c04a853fcc)
@@ -0,0 +1,44 @@
+// 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.
+
+namespace Ringtoets.GrassCoverErosionInwards.IO.Readers
+{
+ ///
+ /// Defines the various types of dike height calculations in a read calculation configuration.
+ ///
+ public enum ReadDikeHeightCalculationType
+ {
+ ///
+ /// No calculation.
+ ///
+ NoCalculation = 1,
+
+ ///
+ /// Calculate by using the norm on assessment section.
+ ///
+ CalculateByAssessmentSectionNorm = 2,
+
+ ///
+ /// Calculate using the probability of the specific profile.
+ ///
+ CalculateByProfileSpecificRequiredProbability = 3
+ }
+}
\ No newline at end of file
Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.IO/Readers/ReadDikeHeightCalculationTypeConverter.cs
===================================================================
diff -u
--- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.IO/Readers/ReadDikeHeightCalculationTypeConverter.cs (revision 0)
+++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.IO/Readers/ReadDikeHeightCalculationTypeConverter.cs (revision 69c1988e3c492c44148e112151efb3c04a853fcc)
@@ -0,0 +1,84 @@
+// 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 Ringtoets.GrassCoverErosionInwards.IO.Properties;
+
+namespace Ringtoets.GrassCoverErosionInwards.IO.Readers
+{
+ ///
+ /// Converts to and back.
+ ///
+ public class ReadDikeHeightCalculationTypeConverter : TypeConverter
+ {
+ public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
+ {
+ if (destinationType == typeof(string))
+ {
+ var readDikeHeightCalculationType = (ReadDikeHeightCalculationType) value;
+ switch (readDikeHeightCalculationType)
+ {
+ case ReadDikeHeightCalculationType.NoCalculation:
+ return Resources.ReadDikeHeightCalculationTypeConverter_NoCalculation;
+ case ReadDikeHeightCalculationType.CalculateByAssessmentSectionNorm:
+ return Resources.ReadDikeHeightCalculationTypeConverter_CalculateByAssessmentSectionNorm;
+ case ReadDikeHeightCalculationType.CalculateByProfileSpecificRequiredProbability:
+ return Resources.ReadDikeHeightCalculationTypeConverter_CalculateByProfileSpecificRequiredProbability;
+ default:
+ throw new NotSupportedException();
+ }
+ }
+ return base.ConvertTo(context, culture, value, destinationType);
+ }
+
+ public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
+ {
+ if (sourceType == typeof(string))
+ {
+ return true;
+ }
+ return base.CanConvertFrom(context, sourceType);
+ }
+
+ public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
+ {
+ var text = value as string;
+ if (text != null)
+ {
+ if (text == Resources.ReadDikeHeightCalculationTypeConverter_NoCalculation)
+ {
+ return ReadDikeHeightCalculationType.NoCalculation;
+ }
+ if (text == Resources.ReadDikeHeightCalculationTypeConverter_CalculateByAssessmentSectionNorm)
+ {
+ return ReadDikeHeightCalculationType.CalculateByAssessmentSectionNorm;
+ }
+ if (text == Resources.ReadDikeHeightCalculationTypeConverter_CalculateByProfileSpecificRequiredProbability)
+ {
+ return ReadDikeHeightCalculationType.CalculateByProfileSpecificRequiredProbability;
+ }
+ }
+ return base.ConvertFrom(context, culture, value);
+ }
+ }
+}
\ No newline at end of file
Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.IO/Readers/ReadGrassCoverErosionInwardsCalculation.cs
===================================================================
diff -u -r7a466d4ccb9d859b47f565b400808eb6933b18f0 -r69c1988e3c492c44148e112151efb3c04a853fcc
--- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.IO/Readers/ReadGrassCoverErosionInwardsCalculation.cs (.../ReadGrassCoverErosionInwardsCalculation.cs) (revision 7a466d4ccb9d859b47f565b400808eb6933b18f0)
+++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.IO/Readers/ReadGrassCoverErosionInwardsCalculation.cs (.../ReadGrassCoverErosionInwardsCalculation.cs) (revision 69c1988e3c492c44148e112151efb3c04a853fcc)
@@ -20,9 +20,7 @@
// All rights reserved.
using System;
-using Ringtoets.Common.Data.DikeProfiles;
using Ringtoets.Common.IO.Readers;
-using Ringtoets.GrassCoverErosionInwards.Data;
namespace Ringtoets.GrassCoverErosionInwards.IO.Readers
{
@@ -85,7 +83,7 @@
/// Gets the value for how the dike height should be calculated for the grass cover
/// erosion inwards calculation.
///
- public DikeHeightCalculationType? DikeHeightCalculationType { get; }
+ public ReadDikeHeightCalculationType? DikeHeightCalculationType { get; }
///
/// Gets the value indicating if the break water for the grass cover erosion inwards
@@ -96,7 +94,7 @@
///
/// Gets the type of break water for the grass cover erosion inwards calculation.
///
- public BreakWaterType? BreakWaterType { get; }
+ public ReadBreakWaterType? BreakWaterType { get; }
///
/// Gets the height of the break water for the grass cover erosion inwards calculation.
@@ -156,7 +154,7 @@
///
/// Gets or sets the value for .
///
- public DikeHeightCalculationType? DikeHeightCalculationType { get; set; }
+ public ReadDikeHeightCalculationType? DikeHeightCalculationType { get; set; }
///
/// Gets or sets the value for .
@@ -166,7 +164,7 @@
///
/// Gets or sets the value for .
///
- public BreakWaterType? BreakWaterType { get; set; }
+ public ReadBreakWaterType? BreakWaterType { get; set; }
///
/// Gets or sets the value for .
Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.IO/Ringtoets.GrassCoverErosionInwards.IO.csproj
===================================================================
diff -u -r1144837cd4defc65250e08e83d9ab8583324e21b -r69c1988e3c492c44148e112151efb3c04a853fcc
--- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.IO/Ringtoets.GrassCoverErosionInwards.IO.csproj (.../Ringtoets.GrassCoverErosionInwards.IO.csproj) (revision 1144837cd4defc65250e08e83d9ab8583324e21b)
+++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.IO/Ringtoets.GrassCoverErosionInwards.IO.csproj (.../Ringtoets.GrassCoverErosionInwards.IO.csproj) (revision 69c1988e3c492c44148e112151efb3c04a853fcc)
@@ -41,10 +41,11 @@
Properties\GlobalAssembly.cs
-
+
+
Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.IO/Writers/GrassCoverErosionInwardsCalculationConfigurationWriter.cs
===================================================================
diff -u -rde8a12d20930a82e6cadf8189a136f9804057fab -r69c1988e3c492c44148e112151efb3c04a853fcc
--- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.IO/Writers/GrassCoverErosionInwardsCalculationConfigurationWriter.cs (.../GrassCoverErosionInwardsCalculationConfigurationWriter.cs) (revision de8a12d20930a82e6cadf8189a136f9804057fab)
+++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.IO/Writers/GrassCoverErosionInwardsCalculationConfigurationWriter.cs (.../GrassCoverErosionInwardsCalculationConfigurationWriter.cs) (revision 69c1988e3c492c44148e112151efb3c04a853fcc)
@@ -25,6 +25,7 @@
using Ringtoets.Common.IO.Schema;
using Ringtoets.Common.IO.Writers;
using Ringtoets.GrassCoverErosionInwards.Data;
+using Ringtoets.GrassCoverErosionInwards.IO.Readers;
namespace Ringtoets.GrassCoverErosionInwards.IO.Writers
{
@@ -52,7 +53,7 @@
writer.WriteElementString(
GrassCoverErosionInwardsCalculationConfigurationSchemaIdentifiers.DikeHeightCalculationTypeElement,
- DikeHeightCalculationTypeAsXmlString(input.DikeHeightCalculationType));
+ DikeHeightCalculationTypeAsXmlString((ReadDikeHeightCalculationType) input.DikeHeightCalculationType));
WriteWaveReduction(input, writer);
@@ -97,9 +98,9 @@
XmlConvert.ToString(input.DikeHeight));
}
- private static string DikeHeightCalculationTypeAsXmlString(DikeHeightCalculationType type)
+ private static string DikeHeightCalculationTypeAsXmlString(ReadDikeHeightCalculationType type)
{
- return new DikeHeightCalculationTypeConverter().ConvertToInvariantString(type);
+ return new ReadDikeHeightCalculationTypeConverter().ConvertToInvariantString(type);
}
private static void WriteWaveReduction(GrassCoverErosionInwardsInput input, XmlWriter writer)
Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/DikeHeightCalculationConverterTest.cs
===================================================================
diff -u -ra5c5133ec23681679e77ff31b89e6410d366f247 -r69c1988e3c492c44148e112151efb3c04a853fcc
--- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/DikeHeightCalculationConverterTest.cs (.../DikeHeightCalculationConverterTest.cs) (revision a5c5133ec23681679e77ff31b89e6410d366f247)
+++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/DikeHeightCalculationConverterTest.cs (.../DikeHeightCalculationConverterTest.cs) (revision 69c1988e3c492c44148e112151efb3c04a853fcc)
@@ -22,7 +22,7 @@
using System;
using System.ComponentModel;
using NUnit.Framework;
-using Ringtoets.GrassCoverErosionInwards.Data;
+using Ringtoets.GrassCoverErosionInwards.IO.Readers;
namespace Ringtoets.GrassCoverErosionInwards.IO.Test
{
@@ -33,7 +33,7 @@
public void Constructor_ExpectedValues()
{
// Call
- var converter = new DikeHeightCalculationTypeConverter();
+ var converter = new ReadDikeHeightCalculationTypeConverter();
// Assert
Assert.IsInstanceOf(converter);
@@ -43,7 +43,7 @@
public void CanConvertTo_String_ReturnTrue()
{
// Setup
- var converter = new DikeHeightCalculationTypeConverter();
+ var converter = new ReadDikeHeightCalculationTypeConverter();
// Call
bool canConvertToString = converter.CanConvertTo(typeof(string));
@@ -56,7 +56,7 @@
public void CanConvertTo_NotString_ReturnFalse()
{
// Setup
- var converter = new DikeHeightCalculationTypeConverter();
+ var converter = new ReadDikeHeightCalculationTypeConverter();
// Call
bool canConvert = converter.CanConvertTo(typeof(object));
@@ -66,13 +66,13 @@
}
[Test]
- [TestCase(DikeHeightCalculationType.NoCalculation, "niet")]
- [TestCase(DikeHeightCalculationType.CalculateByAssessmentSectionNorm, "norm")]
- [TestCase(DikeHeightCalculationType.CalculateByProfileSpecificRequiredProbability, "doorsnede")]
- public void ConvertTo_VariousCases_ReturnExpectedValues(DikeHeightCalculationType value, string expectedResult)
+ [TestCase(ReadDikeHeightCalculationType.NoCalculation, "niet")]
+ [TestCase(ReadDikeHeightCalculationType.CalculateByAssessmentSectionNorm, "norm")]
+ [TestCase(ReadDikeHeightCalculationType.CalculateByProfileSpecificRequiredProbability, "doorsnede")]
+ public void ConvertTo_VariousCases_ReturnExpectedValues(ReadDikeHeightCalculationType value, string expectedResult)
{
// Setup
- var converter = new DikeHeightCalculationTypeConverter();
+ var converter = new ReadDikeHeightCalculationTypeConverter();
// Call
object result = converter.ConvertTo(value, typeof(string));
@@ -85,9 +85,9 @@
public void ConvertTo_InvalidDikeHeightCalculationTypeValue_ThrowNotSupportedException()
{
// Setup
- var converter = new DikeHeightCalculationTypeConverter();
+ var converter = new ReadDikeHeightCalculationTypeConverter();
- var invalidValue = (DikeHeightCalculationType) 9999999;
+ var invalidValue = (ReadDikeHeightCalculationType) 9999999;
// Call
TestDelegate call = () => converter.ConvertTo(invalidValue, typeof(string));
@@ -100,10 +100,10 @@
public void ConvertTo_Object_ThrowNotSupportedException()
{
// Setup
- var converter = new DikeHeightCalculationTypeConverter();
+ var converter = new ReadDikeHeightCalculationTypeConverter();
// Call
- TestDelegate call = () => converter.ConvertTo(DikeHeightCalculationType.NoCalculation, typeof(object));
+ TestDelegate call = () => converter.ConvertTo(ReadDikeHeightCalculationType.NoCalculation, typeof(object));
// Assert
Assert.Throws(call);
@@ -113,7 +113,7 @@
public void CanConvertFrom_String_ReturnTrue()
{
// Setup
- var converter = new DikeHeightCalculationTypeConverter();
+ var converter = new ReadDikeHeightCalculationTypeConverter();
// Call
bool canConvertFromString = converter.CanConvertFrom(typeof(string));
@@ -126,7 +126,7 @@
public void CanConvertFrom_NonString_ReturnFalse()
{
// Setup
- var converter = new DikeHeightCalculationTypeConverter();
+ var converter = new ReadDikeHeightCalculationTypeConverter();
// Call
bool canConvert = converter.CanConvertFrom(typeof(object));
@@ -136,13 +136,13 @@
}
[Test]
- [TestCase("niet", DikeHeightCalculationType.NoCalculation)]
- [TestCase("norm", DikeHeightCalculationType.CalculateByAssessmentSectionNorm)]
- [TestCase("doorsnede", DikeHeightCalculationType.CalculateByProfileSpecificRequiredProbability)]
- public void ConvertFrom_VariousCases_ReturnExpectedValue(string value, DikeHeightCalculationType expectedResult)
+ [TestCase("niet", ReadDikeHeightCalculationType.NoCalculation)]
+ [TestCase("norm", ReadDikeHeightCalculationType.CalculateByAssessmentSectionNorm)]
+ [TestCase("doorsnede", ReadDikeHeightCalculationType.CalculateByProfileSpecificRequiredProbability)]
+ public void ConvertFrom_VariousCases_ReturnExpectedValue(string value, ReadDikeHeightCalculationType expectedResult)
{
// Setup
- var converter = new DikeHeightCalculationTypeConverter();
+ var converter = new ReadDikeHeightCalculationTypeConverter();
// Call
object result = converter.ConvertFrom(value);
@@ -155,7 +155,7 @@
public void ConvertFrom_UnsupportedString_ThrowNotSupportedException()
{
// Setup
- var converter = new DikeHeightCalculationTypeConverter();
+ var converter = new ReadDikeHeightCalculationTypeConverter();
// Call
TestDelegate call = () => converter.ConvertFrom("");
Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/Importers/GrassCoverErosionInwardsCalculationConfigurationImporterTest.cs
===================================================================
diff -u -r9448c9f34da890e184722d00c3f8b4f765a246b0 -r69c1988e3c492c44148e112151efb3c04a853fcc
--- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/Importers/GrassCoverErosionInwardsCalculationConfigurationImporterTest.cs (.../GrassCoverErosionInwardsCalculationConfigurationImporterTest.cs) (revision 9448c9f34da890e184722d00c3f8b4f765a246b0)
+++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/Importers/GrassCoverErosionInwardsCalculationConfigurationImporterTest.cs (.../GrassCoverErosionInwardsCalculationConfigurationImporterTest.cs) (revision 69c1988e3c492c44148e112151efb3c04a853fcc)
@@ -245,23 +245,11 @@
public void Import_ValidConfigurationWithoutForeshoreProfileNotUsed_DataAddedToModel()
{
// Setup
- string filePath = Path.Combine(path, "validConfigurationFullCalculation.xml");
+ string filePath = Path.Combine(path, "validConfigurationCalculationNotUseForeshoreWithoutGeometry.xml");
var calculationGroup = new CalculationGroup();
var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "HRlocatie", 10, 20);
- var dikeProfile = new DikeProfile(new Point2D(0, 0), new[]
- {
- new RoughnessPoint(new Point2D(0, 0), 2.1),
- new RoughnessPoint(new Point2D(1, 1), 3.9),
- new RoughnessPoint(new Point2D(2, 2), 5.2)
- },
- Enumerable.Empty(),
- new BreakWater(BreakWaterType.Caisson, 0), new DikeProfile.ConstructionProperties
- {
- Id = "id",
- Name = "Dijkprofiel",
- DikeHeight = 3.45
- });
+ var dikeProfile = new TestDikeProfile("Dijkprofiel");
var importer = new GrassCoverErosionInwardsCalculationConfigurationImporter(
filePath,
@@ -286,22 +274,7 @@
Name = "Berekening 1",
InputParameters =
{
- HydraulicBoundaryLocation = hydraulicBoundaryLocation,
- DikeProfile = dikeProfile,
- DikeHeightCalculationType = DikeHeightCalculationType.CalculateByAssessmentSectionNorm,
- Orientation = (RoundedDouble) 5.5,
- UseForeshore = false,
- UseBreakWater = true,
- BreakWater =
- {
- Height = (RoundedDouble) 6.6,
- Type = BreakWaterType.Caisson
- },
- CriticalFlowRate =
- {
- Mean = (RoundedDouble) 2.0,
- StandardDeviation = (RoundedDouble) 1.1
- }
+ DikeProfile = dikeProfile
}
};
@@ -361,7 +334,7 @@
DikeProfile = dikeProfile,
DikeHeightCalculationType = DikeHeightCalculationType.CalculateByAssessmentSectionNorm,
Orientation = (RoundedDouble) 5.5,
- UseForeshore = false,
+ UseForeshore = true,
UseBreakWater = true,
BreakWater =
{
Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/Readers/GrassCoverErosionInwardsCalculationConfigurationReaderTest.cs
===================================================================
diff -u -ra5c5133ec23681679e77ff31b89e6410d366f247 -r69c1988e3c492c44148e112151efb3c04a853fcc
--- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/Readers/GrassCoverErosionInwardsCalculationConfigurationReaderTest.cs (.../GrassCoverErosionInwardsCalculationConfigurationReaderTest.cs) (revision a5c5133ec23681679e77ff31b89e6410d366f247)
+++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/Readers/GrassCoverErosionInwardsCalculationConfigurationReaderTest.cs (.../GrassCoverErosionInwardsCalculationConfigurationReaderTest.cs) (revision 69c1988e3c492c44148e112151efb3c04a853fcc)
@@ -26,9 +26,7 @@
using Core.Common.Base.IO;
using Core.Common.TestUtil;
using NUnit.Framework;
-using Ringtoets.Common.Data.DikeProfiles;
using Ringtoets.Common.IO.Readers;
-using Ringtoets.GrassCoverErosionInwards.Data;
using Ringtoets.GrassCoverErosionInwards.IO.Readers;
namespace Ringtoets.GrassCoverErosionInwards.IO.Test.Readers
@@ -332,9 +330,9 @@
Assert.AreEqual("some_dike_profile", calculation.DikeProfile);
Assert.AreEqual(67.1, calculation.Orientation);
Assert.AreEqual(3.45, calculation.DikeHeight);
- Assert.AreEqual(DikeHeightCalculationType.CalculateByAssessmentSectionNorm, calculation.DikeHeightCalculationType);
+ Assert.AreEqual(ReadDikeHeightCalculationType.CalculateByAssessmentSectionNorm, calculation.DikeHeightCalculationType);
Assert.AreEqual(true, calculation.UseBreakWater);
- Assert.AreEqual(BreakWaterType.Dam, calculation.BreakWaterType);
+ Assert.AreEqual(ReadBreakWaterType.Dam, calculation.BreakWaterType);
Assert.AreEqual(1.234, calculation.BreakWaterHeight);
Assert.AreEqual(false, calculation.UseForeshore);
Assert.AreEqual(0.1, calculation.CriticalFlowRateMean);
Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/Readers/ReadGrassCoverErosionInwardsCalculationTest.cs
===================================================================
diff -u -r7a466d4ccb9d859b47f565b400808eb6933b18f0 -r69c1988e3c492c44148e112151efb3c04a853fcc
--- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/Readers/ReadGrassCoverErosionInwardsCalculationTest.cs (.../ReadGrassCoverErosionInwardsCalculationTest.cs) (revision 7a466d4ccb9d859b47f565b400808eb6933b18f0)
+++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/Readers/ReadGrassCoverErosionInwardsCalculationTest.cs (.../ReadGrassCoverErosionInwardsCalculationTest.cs) (revision 69c1988e3c492c44148e112151efb3c04a853fcc)
@@ -21,9 +21,7 @@
using System;
using NUnit.Framework;
-using Ringtoets.Common.Data.DikeProfiles;
using Ringtoets.Common.IO.Readers;
-using Ringtoets.GrassCoverErosionInwards.Data;
using Ringtoets.GrassCoverErosionInwards.IO.Readers;
namespace Ringtoets.GrassCoverErosionInwards.IO.Test.Readers
@@ -74,9 +72,9 @@
const string dikeProfileName = "name of the dike profile";
const double orientation = 1.1;
const double dikeHeight = 2.2;
- var calculationType = DikeHeightCalculationType.CalculateByAssessmentSectionNorm;
+ const ReadDikeHeightCalculationType calculationType = ReadDikeHeightCalculationType.CalculateByAssessmentSectionNorm;
const bool useBreakWater = true;
- var breakWaterType = BreakWaterType.Wall;
+ const ReadBreakWaterType breakWaterType = ReadBreakWaterType.Wall;
const double breakWaterHeight = 3.3;
const bool useForeshore = true;
const double criticalFlowMean = 4.4;
Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/test-data/GrassCoverErosionInwardsCalculationConfigurationImporter/validConfigurationCalculationNotUseForeshoreWithoutGeometry.xml
===================================================================
diff -u
--- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/test-data/GrassCoverErosionInwardsCalculationConfigurationImporter/validConfigurationCalculationNotUseForeshoreWithoutGeometry.xml (revision 0)
+++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/test-data/GrassCoverErosionInwardsCalculationConfigurationImporter/validConfigurationCalculationNotUseForeshoreWithoutGeometry.xml (revision 69c1988e3c492c44148e112151efb3c04a853fcc)
@@ -0,0 +1,9 @@
+
+
+
+ Dijkprofiel
+
+ false
+
+
+
Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/test-data/GrassCoverErosionInwardsCalculationConfigurationImporter/validConfigurationCalculationUseForeshoreWithoutGeometry.xml
===================================================================
diff -u -r1144837cd4defc65250e08e83d9ab8583324e21b -r69c1988e3c492c44148e112151efb3c04a853fcc
--- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/test-data/GrassCoverErosionInwardsCalculationConfigurationImporter/validConfigurationCalculationUseForeshoreWithoutGeometry.xml (.../validConfigurationCalculationUseForeshoreWithoutGeometry.xml) (revision 1144837cd4defc65250e08e83d9ab8583324e21b)
+++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/test-data/GrassCoverErosionInwardsCalculationConfigurationImporter/validConfigurationCalculationUseForeshoreWithoutGeometry.xml (.../validConfigurationCalculationUseForeshoreWithoutGeometry.xml) (revision 69c1988e3c492c44148e112151efb3c04a853fcc)
@@ -3,7 +3,7 @@
Dijkprofiel
- false
+ true
Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/test-data/GrassCoverErosionInwardsCalculationConfigurationImporter/validConfigurationFullCalculation.xml
===================================================================
diff -u -r9448c9f34da890e184722d00c3f8b4f765a246b0 -r69c1988e3c492c44148e112151efb3c04a853fcc
--- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/test-data/GrassCoverErosionInwardsCalculationConfigurationImporter/validConfigurationFullCalculation.xml (.../validConfigurationFullCalculation.xml) (revision 9448c9f34da890e184722d00c3f8b4f765a246b0)
+++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/test-data/GrassCoverErosionInwardsCalculationConfigurationImporter/validConfigurationFullCalculation.xml (.../validConfigurationFullCalculation.xml) (revision 69c1988e3c492c44148e112151efb3c04a853fcc)
@@ -10,7 +10,7 @@
truecaisson6.6
- false
+ true
Index: Ringtoets/Revetment/src/Ringtoets.Revetment.IO/Importers/WaveConditionsCalculationConfigurationImporter.cs
===================================================================
diff -u -rae6ef0985e7b64acca060b6782e21a3446548366 -r69c1988e3c492c44148e112151efb3c04a853fcc
--- Ringtoets/Revetment/src/Ringtoets.Revetment.IO/Importers/WaveConditionsCalculationConfigurationImporter.cs (.../WaveConditionsCalculationConfigurationImporter.cs) (revision ae6ef0985e7b64acca060b6782e21a3446548366)
+++ Ringtoets/Revetment/src/Ringtoets.Revetment.IO/Importers/WaveConditionsCalculationConfigurationImporter.cs (.../WaveConditionsCalculationConfigurationImporter.cs) (revision 69c1988e3c492c44148e112151efb3c04a853fcc)
@@ -228,7 +228,7 @@
{
if (readCalculation.StepSize.HasValue)
{
- calculation.InputParameters.StepSize = readCalculation.StepSize.Value;
+ calculation.InputParameters.StepSize = (WaveConditionsInputStepSize) readCalculation.StepSize.Value;
}
}
@@ -314,7 +314,7 @@
if (readCalculation.BreakWaterType.HasValue)
{
- calculation.InputParameters.BreakWater.Type = readCalculation.BreakWaterType.Value;
+ calculation.InputParameters.BreakWater.Type = (BreakWaterType) readCalculation.BreakWaterType.Value;
}
if (readCalculation.BreakWaterHeight.HasValue)
Index: Ringtoets/Revetment/src/Ringtoets.Revetment.IO/Readers/ReadWaveConditionsCalculation.cs
===================================================================
diff -u -r29289635457e7d05e24c8fb923e0c6f56f152add -r69c1988e3c492c44148e112151efb3c04a853fcc
--- Ringtoets/Revetment/src/Ringtoets.Revetment.IO/Readers/ReadWaveConditionsCalculation.cs (.../ReadWaveConditionsCalculation.cs) (revision 29289635457e7d05e24c8fb923e0c6f56f152add)
+++ Ringtoets/Revetment/src/Ringtoets.Revetment.IO/Readers/ReadWaveConditionsCalculation.cs (.../ReadWaveConditionsCalculation.cs) (revision 69c1988e3c492c44148e112151efb3c04a853fcc)
@@ -86,7 +86,7 @@
///
/// Gets the step size of the read calculation.
///
- public WaveConditionsInputStepSize? StepSize { get; }
+ public ReadWaveConditionsInputStepSize? StepSize { get; }
///
/// Gets the name of the foreshore profile of the read calculation.
@@ -106,7 +106,7 @@
///
/// Gets the breakwater type of the read calculation.
///
- public BreakWaterType? BreakWaterType { get; }
+ public ReadBreakWaterType? BreakWaterType { get; }
///
/// Gets the breakwater height of the read calculation.
@@ -158,7 +158,7 @@
///
/// Gets or sets the value for .
///
- public WaveConditionsInputStepSize? StepSize{ internal get; set; }
+ public ReadWaveConditionsInputStepSize? StepSize{ internal get; set; }
///
/// Gets or sets the value for .
@@ -178,7 +178,7 @@
///
/// Gets or sets the value for .
///
- public BreakWaterType? BreakWaterType { internal get; set; }
+ public ReadBreakWaterType? BreakWaterType { internal get; set; }
///
/// Gets or sets the value for .
Index: Ringtoets/Revetment/src/Ringtoets.Revetment.IO/Readers/ReadWaveConditionsInputStepSize.cs
===================================================================
diff -u
--- Ringtoets/Revetment/src/Ringtoets.Revetment.IO/Readers/ReadWaveConditionsInputStepSize.cs (revision 0)
+++ Ringtoets/Revetment/src/Ringtoets.Revetment.IO/Readers/ReadWaveConditionsInputStepSize.cs (revision 69c1988e3c492c44148e112151efb3c04a853fcc)
@@ -0,0 +1,44 @@
+// 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.
+
+namespace Ringtoets.Revetment.IO.Readers
+{
+ ///
+ /// Enum defining the possible step size value in a read wave conditions calculation.
+ ///
+ public enum ReadWaveConditionsInputStepSize
+ {
+ ///
+ /// A step size of 0.5
+ ///
+ Half = 1,
+
+ ///
+ /// A step size of 1.0
+ ///
+ One = 2,
+
+ ///
+ /// A step size of 2.0
+ ///
+ Two = 3
+ }
+}
\ No newline at end of file
Index: Ringtoets/Revetment/src/Ringtoets.Revetment.IO/Readers/ReadWaveConditionsInputStepSizeConverter.cs
===================================================================
diff -u
--- Ringtoets/Revetment/src/Ringtoets.Revetment.IO/Readers/ReadWaveConditionsInputStepSizeConverter.cs (revision 0)
+++ Ringtoets/Revetment/src/Ringtoets.Revetment.IO/Readers/ReadWaveConditionsInputStepSizeConverter.cs (revision 69c1988e3c492c44148e112151efb3c04a853fcc)
@@ -0,0 +1,86 @@
+// 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;
+
+namespace Ringtoets.Revetment.IO.Readers
+{
+ ///
+ /// Converts to and back.
+ ///
+ public class ReadWaveConditionsInputStepSizeConverter : TypeConverter
+ {
+ public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
+ {
+ if (destinationType == typeof(string))
+ {
+ switch ((ReadWaveConditionsInputStepSize) value)
+ {
+ case ReadWaveConditionsInputStepSize.Half:
+ return FormatStepSizeValue(culture, 0.5);
+ case ReadWaveConditionsInputStepSize.One:
+ return FormatStepSizeValue(culture, 1.0);
+ case ReadWaveConditionsInputStepSize.Two:
+ return FormatStepSizeValue(culture, 2.0);
+ }
+ }
+ return base.ConvertTo(context, culture, value, destinationType);
+ }
+
+ public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
+ {
+ if (sourceType == typeof(string))
+ {
+ return true;
+ }
+ return base.CanConvertFrom(context, sourceType);
+ }
+
+ public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
+ {
+ var text = value as string;
+ if (text != null)
+ {
+ string decimalSeperator = culture.NumberFormat.NumberDecimalSeparator;
+ if ($"0{decimalSeperator}5".Equals(text))
+ {
+ return ReadWaveConditionsInputStepSize.Half;
+ }
+ if ($"1{decimalSeperator}0".Equals(text))
+ {
+ return ReadWaveConditionsInputStepSize.One;
+ }
+ if ($"2{decimalSeperator}0".Equals(text))
+ {
+ return ReadWaveConditionsInputStepSize.Two;
+ }
+ }
+ return base.ConvertFrom(context, culture, value);
+ }
+
+ private static string FormatStepSizeValue(CultureInfo culture, double stepSizeValue)
+ {
+ return string.Format(culture, "{0:0.0}", stepSizeValue);
+ }
+ }
+}
\ No newline at end of file
Index: Ringtoets/Revetment/src/Ringtoets.Revetment.IO/Readers/WaveConditionsCalculationConfigurationReader.cs
===================================================================
diff -u -ra5c5133ec23681679e77ff31b89e6410d366f247 -r69c1988e3c492c44148e112151efb3c04a853fcc
--- Ringtoets/Revetment/src/Ringtoets.Revetment.IO/Readers/WaveConditionsCalculationConfigurationReader.cs (.../WaveConditionsCalculationConfigurationReader.cs) (revision a5c5133ec23681679e77ff31b89e6410d366f247)
+++ Ringtoets/Revetment/src/Ringtoets.Revetment.IO/Readers/WaveConditionsCalculationConfigurationReader.cs (.../WaveConditionsCalculationConfigurationReader.cs) (revision 69c1988e3c492c44148e112151efb3c04a853fcc)
@@ -23,11 +23,9 @@
using System.Collections.Generic;
using System.Xml.Linq;
using Core.Common.Base.IO;
-using Ringtoets.Common.Data.DikeProfiles;
using Ringtoets.Common.IO;
using Ringtoets.Common.IO.Readers;
using Ringtoets.Common.IO.Schema;
-using Ringtoets.Revetment.Data;
using Ringtoets.Revetment.IO.Properties;
using RingtoestCommonIOResources = Ringtoets.Common.IO.Properties.Resources;
@@ -86,11 +84,11 @@
LowerBoundaryRevetment = calculationElement.GetDoubleValueFromDescendantElement(WaveConditionsCalculationConfigurationSchemaIdentifiers.LowerBoundaryRevetment),
UpperBoundaryWaterLevels = calculationElement.GetDoubleValueFromDescendantElement(WaveConditionsCalculationConfigurationSchemaIdentifiers.UpperBoundaryWaterLevels),
LowerBoundaryWaterLevels = calculationElement.GetDoubleValueFromDescendantElement(WaveConditionsCalculationConfigurationSchemaIdentifiers.LowerBoundaryWaterLevels),
- StepSize = (WaveConditionsInputStepSize?) calculationElement.GetConvertedValueFromDescendantElement(WaveConditionsCalculationConfigurationSchemaIdentifiers.StepSize),
+ StepSize = (ReadWaveConditionsInputStepSize?) calculationElement.GetConvertedValueFromDescendantElement(WaveConditionsCalculationConfigurationSchemaIdentifiers.StepSize),
ForeshoreProfile = calculationElement.GetStringValueFromDescendantElement(WaveConditionsCalculationConfigurationSchemaIdentifiers.ForeshoreProfile),
Orientation = calculationElement.GetDoubleValueFromDescendantElement(ConfigurationSchemaIdentifiers.Orientation),
UseBreakWater = calculationElement.GetBoolValueFromDescendantElement(ConfigurationSchemaIdentifiers.UseBreakWater),
- BreakWaterType = (BreakWaterType?)calculationElement.GetConvertedValueFromDescendantElement(ConfigurationSchemaIdentifiers.BreakWaterType),
+ BreakWaterType = (ReadBreakWaterType?)calculationElement.GetConvertedValueFromDescendantElement(ConfigurationSchemaIdentifiers.BreakWaterType),
BreakWaterHeight = calculationElement.GetDoubleValueFromDescendantElement(ConfigurationSchemaIdentifiers.BreakWaterHeight),
UseForeshore = calculationElement.GetBoolValueFromDescendantElement(ConfigurationSchemaIdentifiers.UseForeshore)
};
Index: Ringtoets/Revetment/src/Ringtoets.Revetment.IO/Ringtoets.Revetment.IO.csproj
===================================================================
diff -u -r09fb591f0e8017e22b62ca554f6eceeeafa51219 -r69c1988e3c492c44148e112151efb3c04a853fcc
--- Ringtoets/Revetment/src/Ringtoets.Revetment.IO/Ringtoets.Revetment.IO.csproj (.../Ringtoets.Revetment.IO.csproj) (revision 09fb591f0e8017e22b62ca554f6eceeeafa51219)
+++ Ringtoets/Revetment/src/Ringtoets.Revetment.IO/Ringtoets.Revetment.IO.csproj (.../Ringtoets.Revetment.IO.csproj) (revision 69c1988e3c492c44148e112151efb3c04a853fcc)
@@ -56,11 +56,12 @@
Resources.resx
+
-
+
Fisheye: Tag 69c1988e3c492c44148e112151efb3c04a853fcc refers to a dead (removed) revision in file `Ringtoets/Revetment/src/Ringtoets.Revetment.IO/WaveConditionsInputStepSizeConverter.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Ringtoets/Revetment/src/Ringtoets.Revetment.IO/Writers/WaveConditionsCalculationConfigurationWriter.cs
===================================================================
diff -u -rb731017e828e47ed72aa803dfcc7eeaa7f770933 -r69c1988e3c492c44148e112151efb3c04a853fcc
--- Ringtoets/Revetment/src/Ringtoets.Revetment.IO/Writers/WaveConditionsCalculationConfigurationWriter.cs (.../WaveConditionsCalculationConfigurationWriter.cs) (revision b731017e828e47ed72aa803dfcc7eeaa7f770933)
+++ Ringtoets/Revetment/src/Ringtoets.Revetment.IO/Writers/WaveConditionsCalculationConfigurationWriter.cs (.../WaveConditionsCalculationConfigurationWriter.cs) (revision 69c1988e3c492c44148e112151efb3c04a853fcc)
@@ -26,6 +26,7 @@
using Ringtoets.Common.IO.Schema;
using Ringtoets.Common.IO.Writers;
using Ringtoets.Revetment.Data;
+using Ringtoets.Revetment.IO.Readers;
namespace Ringtoets.Revetment.IO.Writers
{
@@ -36,14 +37,14 @@
/// The type of calculations that are written to file.
public abstract class WaveConditionsCalculationConfigurationWriter : CalculationConfigurationWriter where T : class, ICalculation
{
- private readonly WaveConditionsInputStepSizeConverter waveConditionsInputStepSizeConverter;
+ private readonly ReadWaveConditionsInputStepSizeConverter readWaveConditionsInputStepSizeConverter;
///
/// Created a new instance of .
///
protected WaveConditionsCalculationConfigurationWriter()
{
- waveConditionsInputStepSizeConverter = new WaveConditionsInputStepSizeConverter();
+ readWaveConditionsInputStepSizeConverter = new ReadWaveConditionsInputStepSizeConverter();
}
///
@@ -73,7 +74,7 @@
XmlConvert.ToString(input.LowerBoundaryWaterLevels));
writer.WriteElementString(
WaveConditionsCalculationConfigurationSchemaIdentifiers.StepSize,
- waveConditionsInputStepSizeConverter.ConvertToInvariantString(input.StepSize));
+ readWaveConditionsInputStepSizeConverter.ConvertToInvariantString((ReadWaveConditionsInputStepSize) input.StepSize));
WriteForeshoreProfile(input.ForeshoreProfile, writer);
Index: Ringtoets/Revetment/test/Ringtoets.Revetment.IO.Test/Readers/ReadWaveConditionsCalculationTest.cs
===================================================================
diff -u -r29289635457e7d05e24c8fb923e0c6f56f152add -r69c1988e3c492c44148e112151efb3c04a853fcc
--- Ringtoets/Revetment/test/Ringtoets.Revetment.IO.Test/Readers/ReadWaveConditionsCalculationTest.cs (.../ReadWaveConditionsCalculationTest.cs) (revision 29289635457e7d05e24c8fb923e0c6f56f152add)
+++ Ringtoets/Revetment/test/Ringtoets.Revetment.IO.Test/Readers/ReadWaveConditionsCalculationTest.cs (.../ReadWaveConditionsCalculationTest.cs) (revision 69c1988e3c492c44148e112151efb3c04a853fcc)
@@ -75,11 +75,11 @@
const double lowerBoundaryRevetment = 2.2;
const double upperBoundaryWaterLevels = 3.3;
const double lowerBoundaryWaterLevels = 4.4;
- const WaveConditionsInputStepSize stepSize = WaveConditionsInputStepSize.Half;
+ const ReadWaveConditionsInputStepSize stepSize = ReadWaveConditionsInputStepSize.Half;
const string foreshoreProfileName = "Name of the foreshore profile";
const double orientation = 6.6;
const bool useBreakWater = true;
- const BreakWaterType breakWaterType = BreakWaterType.Caisson;
+ const ReadBreakWaterType breakWaterType = ReadBreakWaterType.Caisson;
const double breakWaterHeight = 7.7;
const bool useForeshore = false;
Index: Ringtoets/Revetment/test/Ringtoets.Revetment.IO.Test/Readers/WaveConditionsCalculationConfigurationReaderTest.cs
===================================================================
diff -u -ra5c5133ec23681679e77ff31b89e6410d366f247 -r69c1988e3c492c44148e112151efb3c04a853fcc
--- Ringtoets/Revetment/test/Ringtoets.Revetment.IO.Test/Readers/WaveConditionsCalculationConfigurationReaderTest.cs (.../WaveConditionsCalculationConfigurationReaderTest.cs) (revision a5c5133ec23681679e77ff31b89e6410d366f247)
+++ Ringtoets/Revetment/test/Ringtoets.Revetment.IO.Test/Readers/WaveConditionsCalculationConfigurationReaderTest.cs (.../WaveConditionsCalculationConfigurationReaderTest.cs) (revision 69c1988e3c492c44148e112151efb3c04a853fcc)
@@ -26,9 +26,7 @@
using Core.Common.Base.IO;
using Core.Common.TestUtil;
using NUnit.Framework;
-using Ringtoets.Common.Data.DikeProfiles;
using Ringtoets.Common.IO.Readers;
-using Ringtoets.Revetment.Data;
using Ringtoets.Revetment.IO.Readers;
namespace Ringtoets.Revetment.IO.Test.Readers
@@ -330,11 +328,11 @@
Assert.AreEqual(2.2, calculation.LowerBoundaryRevetment);
Assert.AreEqual(3.3, calculation.UpperBoundaryWaterLevels);
Assert.AreEqual(4.4, calculation.LowerBoundaryWaterLevels);
- Assert.AreEqual(WaveConditionsInputStepSize.Half, calculation.StepSize);
+ Assert.AreEqual(ReadWaveConditionsInputStepSize.Half, calculation.StepSize);
Assert.AreEqual("Voorlandprofiel", calculation.ForeshoreProfile);
Assert.AreEqual(5.5, calculation.Orientation);
Assert.IsTrue(calculation.UseBreakWater);
- Assert.AreEqual(BreakWaterType.Caisson, calculation.BreakWaterType);
+ Assert.AreEqual(ReadBreakWaterType.Caisson, calculation.BreakWaterType);
Assert.AreEqual(6.6, calculation.BreakWaterHeight);
Assert.IsFalse(calculation.UseForeshore);
}
@@ -360,11 +358,11 @@
Assert.AreEqual(2.2, calculation.LowerBoundaryRevetment);
Assert.IsNull(calculation.UpperBoundaryWaterLevels);
Assert.IsNull(calculation.LowerBoundaryWaterLevels);
- Assert.AreEqual(WaveConditionsInputStepSize.Half, calculation.StepSize);
+ Assert.AreEqual(ReadWaveConditionsInputStepSize.Half, calculation.StepSize);
Assert.IsNull(calculation.ForeshoreProfile);
Assert.IsNull(calculation.Orientation);
Assert.IsTrue(calculation.UseBreakWater);
- Assert.AreEqual(BreakWaterType.Caisson, calculation.BreakWaterType);
+ Assert.AreEqual(ReadBreakWaterType.Caisson, calculation.BreakWaterType);
Assert.AreEqual(3.3, calculation.BreakWaterHeight);
Assert.IsNull(calculation.UseForeshore);
}
Index: Ringtoets/Revetment/test/Ringtoets.Revetment.IO.Test/WaveConditionsInputStepSizeTypeConverterTest.cs
===================================================================
diff -u -r09fb591f0e8017e22b62ca554f6eceeeafa51219 -r69c1988e3c492c44148e112151efb3c04a853fcc
--- Ringtoets/Revetment/test/Ringtoets.Revetment.IO.Test/WaveConditionsInputStepSizeTypeConverterTest.cs (.../WaveConditionsInputStepSizeTypeConverterTest.cs) (revision 09fb591f0e8017e22b62ca554f6eceeeafa51219)
+++ Ringtoets/Revetment/test/Ringtoets.Revetment.IO.Test/WaveConditionsInputStepSizeTypeConverterTest.cs (.../WaveConditionsInputStepSizeTypeConverterTest.cs) (revision 69c1988e3c492c44148e112151efb3c04a853fcc)
@@ -23,7 +23,7 @@
using System.ComponentModel;
using System.Globalization;
using NUnit.Framework;
-using Ringtoets.Revetment.Data;
+using Ringtoets.Revetment.IO.Readers;
namespace Ringtoets.Revetment.IO.Test
{
@@ -34,7 +34,7 @@
public void Constructor_ExpectedValues()
{
// Call
- var converter = new WaveConditionsInputStepSizeConverter();
+ var converter = new ReadWaveConditionsInputStepSizeConverter();
// Assert
Assert.IsInstanceOf(converter);
@@ -44,7 +44,7 @@
public void CanConvertTo_String_ReturnTrue()
{
// Setup
- var converter = new WaveConditionsInputStepSizeConverter();
+ var converter = new ReadWaveConditionsInputStepSizeConverter();
// Call
bool canConvertToString = converter.CanConvertTo(typeof(string));
@@ -57,7 +57,7 @@
public void CanConvertTo_OtherTypeThenString_ReturnFalse()
{
// Setup
- var converter = new WaveConditionsInputStepSizeConverter();
+ var converter = new ReadWaveConditionsInputStepSizeConverter();
// Call
bool canConvertToNonString = converter.CanConvertTo(typeof(object));
@@ -68,14 +68,14 @@
[Test]
[SetCulture("nl-NL")]
- [TestCase(WaveConditionsInputStepSize.Half, "0,5")]
- [TestCase(WaveConditionsInputStepSize.One, "1,0")]
- [TestCase(WaveConditionsInputStepSize.Two, "2,0")]
- public void ConvertTo_ForAllEnumValues_ReturnExpectedText(WaveConditionsInputStepSize value,
+ [TestCase(ReadWaveConditionsInputStepSize.Half, "0,5")]
+ [TestCase(ReadWaveConditionsInputStepSize.One, "1,0")]
+ [TestCase(ReadWaveConditionsInputStepSize.Two, "2,0")]
+ public void ConvertTo_ForAllEnumValues_ReturnExpectedText(ReadWaveConditionsInputStepSize value,
string expectedText)
{
// Setup
- var converter = new WaveConditionsInputStepSizeConverter();
+ var converter = new ReadWaveConditionsInputStepSizeConverter();
// Call
object result = converter.ConvertTo(null, CultureInfo.CurrentCulture, value, typeof(string));
@@ -88,10 +88,10 @@
public void ConvertTo_Object_ThrowNotSupportedException()
{
// Setup
- var converter = new WaveConditionsInputStepSizeConverter();
+ var converter = new ReadWaveConditionsInputStepSizeConverter();
// Call
- TestDelegate call = () => converter.ConvertTo(WaveConditionsInputStepSize.Half, typeof(object));
+ TestDelegate call = () => converter.ConvertTo(ReadWaveConditionsInputStepSize.Half, typeof(object));
// Assert
Assert.Throws(call);
@@ -101,7 +101,7 @@
public void CanConvertFrom_String_ReturnTrue()
{
// Setup
- var converter = new WaveConditionsInputStepSizeConverter();
+ var converter = new ReadWaveConditionsInputStepSizeConverter();
// Call
bool canConvertFromString = converter.CanConvertFrom(typeof(string));
@@ -114,7 +114,7 @@
public void CanConvertFrom_NonString_ReturnFalse()
{
// Setup
- var converter = new WaveConditionsInputStepSizeConverter();
+ var converter = new ReadWaveConditionsInputStepSizeConverter();
// Call
bool canConvertFromString = converter.CanConvertFrom(typeof(object));
@@ -125,14 +125,14 @@
[Test]
[SetCulture("nl-NL")]
- [TestCase("0,5", WaveConditionsInputStepSize.Half)]
- [TestCase("1,0", WaveConditionsInputStepSize.One)]
- [TestCase("2,0", WaveConditionsInputStepSize.Two)]
+ [TestCase("0,5", ReadWaveConditionsInputStepSize.Half)]
+ [TestCase("1,0", ReadWaveConditionsInputStepSize.One)]
+ [TestCase("2,0", ReadWaveConditionsInputStepSize.Two)]
public void ConvertFrom_VariousCasesInCultureNL_ReturnWaveConditionsInputStepSize(string text,
- WaveConditionsInputStepSize expectedResult)
+ ReadWaveConditionsInputStepSize expectedResult)
{
// Setup
- var converter = new WaveConditionsInputStepSizeConverter();
+ var converter = new ReadWaveConditionsInputStepSizeConverter();
// Call
object result = converter.ConvertFrom(null, CultureInfo.CurrentCulture, text);
@@ -143,14 +143,14 @@
[Test]
[SetCulture("en-US")]
- [TestCase("0.5", WaveConditionsInputStepSize.Half)]
- [TestCase("1.0", WaveConditionsInputStepSize.One)]
- [TestCase("2.0", WaveConditionsInputStepSize.Two)]
+ [TestCase("0.5", ReadWaveConditionsInputStepSize.Half)]
+ [TestCase("1.0", ReadWaveConditionsInputStepSize.One)]
+ [TestCase("2.0", ReadWaveConditionsInputStepSize.Two)]
public void ConvertFrom_VariousCasesInCultureEN_ReturnWaveConditionsInputStepSize(string text,
- WaveConditionsInputStepSize expectedResult)
+ ReadWaveConditionsInputStepSize expectedResult)
{
// Setup
- var converter = new WaveConditionsInputStepSizeConverter();
+ var converter = new ReadWaveConditionsInputStepSizeConverter();
// Call
object result = converter.ConvertFrom(null, CultureInfo.CurrentCulture, text);
@@ -164,7 +164,7 @@
public void ConvertFrom_InvalidText_ThrowNotSupportedException()
{
// Setup
- var converter = new WaveConditionsInputStepSizeConverter();
+ var converter = new ReadWaveConditionsInputStepSizeConverter();
// Call
TestDelegate call = () => converter.ConvertFrom("1");