Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/FailureMechanismEntityReadExtensionsTest.cs =================================================================== diff -u -r899d227631395ebeb5154719f7b92a42ddbc6f96 -r764b136687c9fa77c566e120f4ca7256c2ca2b93 --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/FailureMechanismEntityReadExtensionsTest.cs (.../FailureMechanismEntityReadExtensionsTest.cs) (revision 899d227631395ebeb5154719f7b92a42ddbc6f96) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/FailureMechanismEntityReadExtensionsTest.cs (.../FailureMechanismEntityReadExtensionsTest.cs) (revision 764b136687c9fa77c566e120f4ca7256c2ca2b93) @@ -1069,7 +1069,6 @@ public void ReadAsGrassCoverErosionInwardsFailureMechanism_WithCollector_ReturnsNewGrassCoverErosionInwardsFailureMechanismWithPropertiesSet(bool isRelevant) { // Setup - int n = new Random(21).Next(1, 20); var entity = new FailureMechanismEntity { IsRelevant = Convert.ToByte(isRelevant), @@ -1080,7 +1079,7 @@ { new GrassCoverErosionInwardsFailureMechanismMetaEntity { - N = n + N = new Random(39).NextRoundedDouble(1.0, 20.0) } }, CalculationGroupEntity = new CalculationGroupEntity() @@ -1101,6 +1100,7 @@ RoundedDouble actualN = failureMechanism.GeneralInput.N; Assert.AreEqual(entity.GrassCoverErosionInwardsFailureMechanismMetaEntities.Single().N, actualN, actualN.GetAccuracy()); + Assert.IsNull(failureMechanism.DikeProfiles.SourcePath); } @@ -1242,7 +1242,6 @@ public void ReadAsGrassCoverErosionOutwardsFailureMechanism_WithCollector_ReturnsNewGrassCoverErosionOutwardsFailureMechanismWithPropertiesSet(bool isRelevant) { // Setup - int n = new Random(21).Next(1, 20); var entity = new FailureMechanismEntity { IsRelevant = Convert.ToByte(isRelevant), @@ -1253,7 +1252,7 @@ { new GrassCoverErosionOutwardsFailureMechanismMetaEntity { - N = n + N = new Random(39).NextRoundedDouble(1.0, 20.0) } }, CalculationGroupEntity = new CalculationGroupEntity() @@ -1506,7 +1505,7 @@ { new StabilityStoneCoverFailureMechanismMetaEntity { - N = 12.34 + N = new Random(39).NextRoundedDouble(1.0, 20.0) } } }; @@ -1524,6 +1523,9 @@ Assert.AreEqual(entity.NotRelevantComments, failureMechanism.NotRelevantComments.Body); CollectionAssert.IsEmpty(failureMechanism.Sections); + RoundedDouble actualN = failureMechanism.GeneralInput.N; + Assert.AreEqual(entity.StabilityStoneCoverFailureMechanismMetaEntities.Single().N, actualN, actualN.GetAccuracy()); + Assert.IsNull(failureMechanism.ForeshoreProfiles.SourcePath); } @@ -1674,7 +1676,10 @@ CalculationGroupEntity = new CalculationGroupEntity(), WaveImpactAsphaltCoverFailureMechanismMetaEntities = { - new WaveImpactAsphaltCoverFailureMechanismMetaEntity() + new WaveImpactAsphaltCoverFailureMechanismMetaEntity + { + DeltaL = new Random(39).NextRoundedDouble(1.0, 2000.0) + } } }; var collector = new ReadConversionCollector(); @@ -1691,6 +1696,9 @@ Assert.AreEqual(entity.NotRelevantComments, failureMechanism.NotRelevantComments.Body); CollectionAssert.IsEmpty(failureMechanism.Sections); + RoundedDouble actualDeltaL = failureMechanism.GeneralWaveImpactAsphaltCoverInput.DeltaL; + Assert.AreEqual(entity.WaveImpactAsphaltCoverFailureMechanismMetaEntities.Single().DeltaL, actualDeltaL, actualDeltaL.GetAccuracy()); + Assert.IsNull(failureMechanism.ForeshoreProfiles.SourcePath); } @@ -1720,7 +1728,10 @@ }, WaveImpactAsphaltCoverFailureMechanismMetaEntities = { - new WaveImpactAsphaltCoverFailureMechanismMetaEntity() + new WaveImpactAsphaltCoverFailureMechanismMetaEntity + { + DeltaL = new Random(39).NextRoundedDouble(1.0, 2000.0) + } } }; var collector = new ReadConversionCollector(); @@ -1752,7 +1763,8 @@ { new WaveImpactAsphaltCoverFailureMechanismMetaEntity { - ForeshoreProfileCollectionSourcePath = fileLocation + ForeshoreProfileCollectionSourcePath = fileLocation, + DeltaL = new Random(39).NextRoundedDouble(1.0, 2000.0) } } }; @@ -1796,7 +1808,8 @@ { new WaveImpactAsphaltCoverFailureMechanismMetaEntity { - ForeshoreProfileCollectionSourcePath = fileLocation + ForeshoreProfileCollectionSourcePath = fileLocation, + DeltaL = new Random(39).NextRoundedDouble(1.0, 2000.0) } } }; @@ -1839,7 +1852,7 @@ { new HeightStructuresFailureMechanismMetaEntity { - N = 1 + N = new Random(39).NextRoundedDouble(1.0, 20.0) } } }; @@ -1857,6 +1870,9 @@ Assert.AreEqual(entity.NotRelevantComments, failureMechanism.NotRelevantComments.Body); CollectionAssert.IsEmpty(failureMechanism.Sections); + RoundedDouble actualN = failureMechanism.GeneralInput.N; + Assert.AreEqual(entity.HeightStructuresFailureMechanismMetaEntities.Single().N, actualN, actualN.GetAccuracy()); + Assert.IsNull(failureMechanism.ForeshoreProfiles.SourcePath); } @@ -2323,7 +2339,7 @@ { new StabilityPointStructuresFailureMechanismMetaEntity { - N = 1 + N = new Random(39).NextRoundedDouble(1.0, 20.0) } } }; @@ -2341,6 +2357,8 @@ Assert.AreEqual(entity.NotRelevantComments, failureMechanism.NotRelevantComments.Body); CollectionAssert.IsEmpty(failureMechanism.Sections); + RoundedDouble actualN = failureMechanism.GeneralInput.N; + Assert.AreEqual(entity.StabilityPointStructuresFailureMechanismMetaEntities.Single().N, actualN, actualN.GetAccuracy()); Assert.IsNull(failureMechanism.ForeshoreProfiles.SourcePath); } @@ -2628,7 +2646,7 @@ { new PipingStructureFailureMechanismMetaEntity { - N = random.NextDouble() + 1.0 + N = random.NextRoundedDouble(1.0, 20.0) } } };