Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Data.Test/ClosingStructuresInputTest.cs =================================================================== diff -u -r7259f846cac0ed1569ee22d9788ca7c2f3ca6445 -r39dd0f7ebd4f9f1069e8e0b357844b8005b26bc5 --- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Data.Test/ClosingStructuresInputTest.cs (.../ClosingStructuresInputTest.cs) (revision 7259f846cac0ed1569ee22d9788ca7c2f3ca6445) +++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Data.Test/ClosingStructuresInputTest.cs (.../ClosingStructuresInputTest.cs) (revision 39dd0f7ebd4f9f1069e8e0b357844b8005b26bc5) @@ -90,7 +90,7 @@ } [Test] - public void Input_StructureNull_DoesNotChangeValues() + public void Structure_Null_ExpectedValues() { var input = new ClosingStructuresInput(); @@ -102,7 +102,7 @@ } [Test] - public void Input_Structure_UpdateValuesAccordingly() + public void Structure_NotNull_ExpectedValues() { // Setup var input = new ClosingStructuresInput(); @@ -118,7 +118,7 @@ #region Hydraulic data [Test] - public void Properties_InsideWaterLevel_ExpectedValues() + public void InsideWaterLevel_Always_ExpectedValues() { // Setup var random = new Random(22); @@ -144,33 +144,13 @@ } [Test] - [TestCase(360.004)] - [TestCase(300)] - [TestCase(0)] - [TestCase(-360.004)] - [TestCase(double.NaN)] - public void Properties_DeviationWaveDirection_ExpectedValues(double validValue) - { - // Setup - var input = new ClosingStructuresInput(); - var deviationWaveDirection = new RoundedDouble(5, validValue); - - // Call - input.DeviationWaveDirection = deviationWaveDirection; - - // Assert - Assert.AreEqual(2, input.DeviationWaveDirection.NumberOfDecimalPlaces); - AssertAreEqual(deviationWaveDirection, input.DeviationWaveDirection); - } - - [Test] [TestCase(400)] [TestCase(360.05)] [TestCase(-360.005)] [TestCase(-400)] [TestCase(double.PositiveInfinity)] [TestCase(double.NegativeInfinity)] - public void Properties_StructureNormalOrientationInvalidValues_ThrowsArgumentOutOfRangeException(double invalidValue) + public void DeviationWaveDirection_InvalidValues_ThrowsArgumentOutOfRangeException(double invalidValue) { // Setup var input = new ClosingStructuresInput(); @@ -184,12 +164,32 @@ expectedMessage); } + [Test] + [TestCase(360.004)] + [TestCase(300)] + [TestCase(0)] + [TestCase(-360.004)] + [TestCase(double.NaN)] + public void DeviationWaveDirection_ValidValues_ExpectedValues(double validValue) + { + // Setup + var input = new ClosingStructuresInput(); + var deviationWaveDirection = new RoundedDouble(5, validValue); + + // Call + input.DeviationWaveDirection = deviationWaveDirection; + + // Assert + Assert.AreEqual(2, input.DeviationWaveDirection.NumberOfDecimalPlaces); + AssertAreEqual(deviationWaveDirection, input.DeviationWaveDirection); + } + #endregion #region Model factors [Test] - public void Properties_DrainCoefficient_ExpectedValues() + public void DrainCoefficient_Always_ExpectedValues() { // Setup var random = new Random(22); @@ -214,7 +214,7 @@ } [Test] - public void Properties_FactorStormDurationOpenStructure_ExpectedValues() + public void FactorStormDurationOpenStructure_Always_ExpectedValues() { // Setup var random = new Random(22); @@ -234,7 +234,7 @@ #region Schematization [Test] - public void Properties_ThresholdHeightOpenWeir_ExpectedValues() + public void ThresholdHeightOpenWeir_Always_ExpectedValues() { // Setup var random = new Random(22); @@ -260,7 +260,7 @@ } [Test] - public void Properties_AreaFlowApertures_ExpectedValues() + public void AreaFlowApertures_Always_ExpectedValues() { // Setup var random = new Random(22); @@ -289,7 +289,7 @@ [TestCase(-1.1)] [TestCase(2)] [TestCase(double.NaN)] - public void Properties_FailureProbabilityOpenStructure_ThrowArgumentOutOfRangeException(double probability) + public void FailureProbabilityOpenStructure_InvalidValues_ThrowsArgumentOutOfRangeException(double probability) { // Setup var input = new ClosingStructuresInput(); @@ -305,7 +305,7 @@ [TestCase(0)] [TestCase(0.5)] [TestCase(1.0)] - public void Properties_FailureProbabilityOpenStructure_ExpectedValues(double probability) + public void FailureProbabilityOpenStructure_ValidValues_ExpectedValues(double probability) { // Setup var input = new ClosingStructuresInput(); @@ -321,7 +321,7 @@ [TestCase(-1.1)] [TestCase(2)] [TestCase(double.NaN)] - public void Properties_FailureProbabilityReparation_ThrowArgumentOutOfRangeException(double probability) + public void FailureProbabilityReparation_InvalidValues_ThrowsArgumentOutOfRangeException(double probability) { // Setup var input = new ClosingStructuresInput(); @@ -337,7 +337,7 @@ [TestCase(0)] [TestCase(0.5)] [TestCase(1.0)] - public void Properties_FailureProbabilityReparation_ExpectedValues(double probability) + public void FailureProbabilityReparation_ValidValues_ExpectedValues(double probability) { // Setup var input = new ClosingStructuresInput(); @@ -350,7 +350,7 @@ } [Test] - public void Properties_LevelCrestStructureNotClosing_ExpectedValues() + public void LevelCrestStructureNotClosing_Always_ExpectedValues() { // Setup var random = new Random(22); @@ -379,7 +379,7 @@ [TestCase(-1.1)] [TestCase(2)] [TestCase(double.NaN)] - public void Properties_ProbabilityOpenStructureBeforeFlooding_ThrowArgumentOutOfRangeException(double probability) + public void ProbabilityOpenStructureBeforeFlooding_InvalidValues_ThrowsArgumentOutOfRangeException(double probability) { // Setup var input = new ClosingStructuresInput(); @@ -395,7 +395,7 @@ [TestCase(0)] [TestCase(0.5)] [TestCase(1.0)] - public void Properties_ProbabilityOpenStructureBeforeFlooding_ExpectedValues(double probability) + public void ProbabilityOpenStructureBeforeFlooding_ValidValues_ExpectedValues(double probability) { // Setup var input = new ClosingStructuresInput(); Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.Test/HeightStructuresInputTest.cs =================================================================== diff -u -r7259f846cac0ed1569ee22d9788ca7c2f3ca6445 -r39dd0f7ebd4f9f1069e8e0b357844b8005b26bc5 --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.Test/HeightStructuresInputTest.cs (.../HeightStructuresInputTest.cs) (revision 7259f846cac0ed1569ee22d9788ca7c2f3ca6445) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.Test/HeightStructuresInputTest.cs (.../HeightStructuresInputTest.cs) (revision 39dd0f7ebd4f9f1069e8e0b357844b8005b26bc5) @@ -34,7 +34,7 @@ public class HeightStructuresInputTest { [Test] - public void Constructor_DefaultPropertyValuesAreSet() + public void Constructor_ExpectedValues() { // Setup var levelCrestStructure = new NormalDistribution(2) @@ -56,7 +56,7 @@ } [Test] - public void Input_StructureNull_DoesNotChangeValues() + public void Structure_Null_ExpectedValues() { // Setup var input = new HeightStructuresInput(); @@ -69,7 +69,7 @@ } [Test] - public void Input_Structure_UpdateValuesAccordingly() + public void Structure_NotNull_ExpectedValues() { // Setup var input = new HeightStructuresInput(); @@ -85,51 +85,51 @@ #region Hydraulic data [Test] - [TestCase(360.004)] - [TestCase(300)] - [TestCase(0)] - [TestCase(-360.004)] - [TestCase(double.NaN)] - public void Properties_DeviationWaveDirection_ExpectedValues(double validValue) + [TestCase(400)] + [TestCase(360.05)] + [TestCase(-360.005)] + [TestCase(-400)] + [TestCase(double.PositiveInfinity)] + [TestCase(double.NegativeInfinity)] + public void DeviationWaveDirection_InvalidValues_ThrowsArgumentOutOfRangeException(double invalidValue) { // Setup var input = new HeightStructuresInput(); - var deviationWaveDirection = new RoundedDouble(5, validValue); // Call - input.DeviationWaveDirection = deviationWaveDirection; + TestDelegate call = () => input.DeviationWaveDirection = (RoundedDouble)invalidValue; // Assert - Assert.AreEqual(2, input.DeviationWaveDirection.NumberOfDecimalPlaces); - AssertAreEqual(deviationWaveDirection, input.DeviationWaveDirection); + const string expectedMessage = "De waarde voor de afwijking van de golfrichting moet in het bereik [-360, 360] liggen."; + TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, expectedMessage); } [Test] - [TestCase(400)] - [TestCase(360.05)] - [TestCase(-360.005)] - [TestCase(-400)] - [TestCase(double.PositiveInfinity)] - [TestCase(double.NegativeInfinity)] - public void Properties_StructureNormalOrientationInvalidValues_ThrowsArgumentOutOfRangeException(double invalidValue) + [TestCase(360.004)] + [TestCase(300)] + [TestCase(0)] + [TestCase(-360.004)] + [TestCase(double.NaN)] + public void DeviationWaveDirection_ValidValues_ExpectedValues(double validValue) { // Setup var input = new HeightStructuresInput(); + var deviationWaveDirection = new RoundedDouble(5, validValue); // Call - TestDelegate call = () => input.DeviationWaveDirection = (RoundedDouble)invalidValue; + input.DeviationWaveDirection = deviationWaveDirection; // Assert - const string expectedMessage = "De waarde voor de afwijking van de golfrichting moet in het bereik [-360, 360] liggen."; - TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, expectedMessage); + Assert.AreEqual(2, input.DeviationWaveDirection.NumberOfDecimalPlaces); + AssertAreEqual(deviationWaveDirection, input.DeviationWaveDirection); } #endregion #region Schematization [Test] - public void Properties_LevelCrestStructure_ExpectedValues() + public void LevelCrestStructure_Always_ExpectedValues() { // Setup var random = new Random(22); Index: Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Data.Test/StabilityPointStructuresInputTest.cs =================================================================== diff -u -r76c6f433b6291cb6289f3c9e1df08c5491b7869d -r39dd0f7ebd4f9f1069e8e0b357844b8005b26bc5 --- Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Data.Test/StabilityPointStructuresInputTest.cs (.../StabilityPointStructuresInputTest.cs) (revision 76c6f433b6291cb6289f3c9e1df08c5491b7869d) +++ Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Data.Test/StabilityPointStructuresInputTest.cs (.../StabilityPointStructuresInputTest.cs) (revision 39dd0f7ebd4f9f1069e8e0b357844b8005b26bc5) @@ -164,7 +164,7 @@ } [Test] - public void Input_StructureNull_DoesNotChangeValues() + public void Structure_Null_ExpectedValues() { var input = new StabilityPointStructuresInput(); @@ -176,7 +176,7 @@ } [Test] - public void Input_Structure_UpdateValuesAccordingly() + public void Structure_NotNull_ExpectedValues() { // Setup var input = new StabilityPointStructuresInput(); @@ -192,7 +192,7 @@ #region Hydraulic data [Test] - public void Properties_VolumicWeightWater_ExpectedValues() + public void VolumicWeightWater_Always_ExpectedValues() { // Setup var input = new StabilityPointStructuresInput(); @@ -208,7 +208,7 @@ } [Test] - public void Properties_InsideWaterLevelFailureConstruction_ExpectedValues() + public void InsideWaterLevelFailureConstruction_Always_ExpectedValues() { // Setup var random = new Random(22); @@ -234,7 +234,7 @@ } [Test] - public void Properties_InsideWaterLevel_ExpectedValues() + public void InsideWaterLevel_Always_ExpectedValues() { // Setup var random = new Random(22); @@ -264,7 +264,7 @@ #region Model factors and critical values [Test] - public void Properties_FactorStormDurationOpenStructure_ExpectedValues() + public void FactorStormDurationOpenStructure_Always_ExpectedValues() { // Setup var input = new StabilityPointStructuresInput(); @@ -280,7 +280,7 @@ } [Test] - public void Properties_DrainCoefficient_ExpectedValues() + public void DrainCoefficient_Always_ExpectedValues() { // Setup var random = new Random(22); @@ -306,7 +306,7 @@ } [Test] - public void Properties_FlowVelocityStructureClosable_ExpectedValues() + public void FlowVelocityStructureClosable_Always_ExpectedValues() { // Setup var random = new Random(22); @@ -336,7 +336,7 @@ #region Schematization [Test] - public void Properties_LevelCrestStructure_ExpectedValues() + public void LevelCrestStructure_Always_ExpectedValues() { // Setup var random = new Random(22); @@ -362,7 +362,7 @@ } [Test] - public void Properties_ThresholdHeightOpenWeir_ExpectedValues() + public void ThresholdHeightOpenWeir_Always_ExpectedValues() { // Setup var random = new Random(22); @@ -388,7 +388,7 @@ } [Test] - public void Properties_AreaFlowApertures_ExpectedValues() + public void AreaFlowApertures_Always_ExpectedValues() { // Setup var random = new Random(22); @@ -414,7 +414,7 @@ } [Test] - public void Properties_ConstructiveStrengthLinearLoadModel_ExpectedValues() + public void ConstructiveStrengthLinearLoadModel_Always_ExpectedValues() { // Setup var random = new Random(22); @@ -440,7 +440,7 @@ } [Test] - public void Properties_ConstructiveStrengthQuadraticLoadModel_ExpectedValues() + public void ConstructiveStrengthQuadraticLoadModel_Always_ExpectedValues() { // Setup var random = new Random(22); @@ -466,7 +466,7 @@ } [Test] - public void Properties_StabilityLinearLoadModel_ExpectedValues() + public void StabilityLinearLoadModel_Always_ExpectedValues() { // Setup var random = new Random(22); @@ -492,7 +492,7 @@ } [Test] - public void Properties_StabilityQuadraticLoadModel() + public void StabilityQuadraticLoadModel_Always_ExpectedValues() { // Setup var random = new Random(22); @@ -521,7 +521,7 @@ [TestCase(-1.1)] [TestCase(2)] [TestCase(double.NaN)] - public void Properties_FailureProbabilityRepairClosure_ThrowArgumentOutOfRangeException(double probability) + public void FailureProbabilityRepairClosure_InvalidValues_ThrowsArgumentOutOfRangeException(double probability) { // Setup var input = new StabilityPointStructuresInput(); @@ -537,7 +537,7 @@ [TestCase(0)] [TestCase(0.5)] [TestCase(1.0)] - public void Properties_FailureProbabilityRepairClosure_ExpectedValues(double probability) + public void FailureProbabilityRepairClosure_ValidValues_ExpectedValues(double probability) { // Setup var input = new StabilityPointStructuresInput(); @@ -550,7 +550,7 @@ } [Test] - public void Properties_FailureCollisionEnergy_ExpectedValues() + public void FailureCollisionEnergy_Always_ExpectedValues() { // Setup var random = new Random(22); @@ -576,7 +576,7 @@ } [Test] - public void Properties_ShipMass_ExpectedValues() + public void ShipMass_Always_ExpectedValues() { // Setup var random = new Random(22); @@ -602,7 +602,7 @@ } [Test] - public void Properties_ShipVelocity_ExpectedValues() + public void ShipVelocity_Always_ExpectedValues() { // Setup var random = new Random(22); @@ -631,7 +631,7 @@ [TestCase(-1.1)] [TestCase(2)] [TestCase(double.NaN)] - public void Properties_ProbabilityCollisionSecondaryStructure_ThrowArgumentOutOfRangeException(double probability) + public void ProbabilityCollisionSecondaryStructure_InvalidValues_ThrowsArgumentOutOfRangeException(double probability) { // Setup var input = new StabilityPointStructuresInput(); @@ -647,7 +647,7 @@ [TestCase(0)] [TestCase(0.5)] [TestCase(1.0)] - public void Properties_ProbabilityCollisionSecondaryStructure_ExpectedValues(double probability) + public void ProbabilityCollisionSecondaryStructure_ValidValues_ExpectedValues(double probability) { // Setup var input = new StabilityPointStructuresInput(); @@ -660,9 +660,9 @@ } [Test] - public void Properties_BankWidth_ExpectedValues() + public void BankWidth_Always_ExpectedValues() { - // Setup + // Setup var random = new Random(22); var input = new StabilityPointStructuresInput(); var mean = (RoundedDouble) (0.01 + random.NextDouble()); @@ -686,7 +686,7 @@ } [Test] - public void Properties_EvaluationLevel_ExpectedValues() + public void EvaluationLevel_Always_ExpectedValues() { // Setup var random = new Random(22); @@ -702,7 +702,7 @@ } [Test] - public void Properties_VerticalDistance_ExpectedValues() + public void VerticalDistance_Always_ExpectedValues() { // Setup var random = new Random(22);