Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/StructuresCalculationCreateExtensionsTest.cs =================================================================== diff -u -rb0bd89548893f5b7a71580db36a2008d7d6f17f5 -rad19a23ec0161425b2c3047c79850cce500dc022 --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/StructuresCalculationCreateExtensionsTest.cs (.../StructuresCalculationCreateExtensionsTest.cs) (revision b0bd89548893f5b7a71580db36a2008d7d6f17f5) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/StructuresCalculationCreateExtensionsTest.cs (.../StructuresCalculationCreateExtensionsTest.cs) (revision ad19a23ec0161425b2c3047c79850cce500dc022) @@ -20,6 +20,7 @@ // All rights reserved. using System; +using System.Linq; using Application.Ringtoets.Storage.Create; using Application.Ringtoets.Storage.DbContext; using Core.Common.Base.Data; @@ -29,9 +30,11 @@ using Ringtoets.ClosingStructures.Data.TestUtil; using Ringtoets.Common.Data.DikeProfiles; using Ringtoets.Common.Data.Hydraulics; +using Ringtoets.Common.Data.IllustrationPoints; using Ringtoets.Common.Data.Probability; using Ringtoets.Common.Data.Structures; using Ringtoets.Common.Data.TestUtil; +using Ringtoets.Common.Data.TestUtil.IllustrationPoints; using Ringtoets.HeightStructures.Data; using Ringtoets.HeightStructures.Data.TestUtil; using Ringtoets.StabilityPointStructures.Data; @@ -42,6 +45,19 @@ [TestFixture] public class StructuresCalculationCreateExtensionsTest { + private static StructuresOutput GetStructuresOutputWithIllustrationPoints() + { + var structuresOutput = new StructuresOutput( + new ProbabilityAssessmentOutput(double.NaN, double.NaN, + double.NaN, double.NaN, + double.NaN)); + structuresOutput.SetIllustrationPoints(new GeneralResult( + WindDirectionTestFactory.CreateTestWindDirection(), + Enumerable.Empty(), + Enumerable.Empty())); + return structuresOutput; + } + #region CreateForHeightStructures [Test] @@ -349,6 +365,26 @@ Assert.AreEqual(1, entity.HeightStructuresOutputEntities.Count); } + [Test] + public void CreateForHeightStructures_CalculationWithOutputAndIllustrationPoints_ReturnEntityWithOutputAndIllustrationPoints() + { + // Setup + var calculation = new StructuresCalculation + { + Output = GetStructuresOutputWithIllustrationPoints() + }; + + var registry = new PersistenceRegistry(); + + // Call + HeightStructuresCalculationEntity entity = calculation.CreateForHeightStructures(registry, 0); + + // Assert + HeightStructuresOutputEntity outputEntity = entity.HeightStructuresOutputEntities.FirstOrDefault(); + Assert.IsNotNull(outputEntity); + Assert.IsNotNull(outputEntity.GeneralResultFaultTreeIllustrationPointEntity); + } + #endregion #region CreateForClosingStructures @@ -714,6 +750,26 @@ Assert.AreEqual(1, entity.ClosingStructuresOutputEntities.Count); } + [Test] + public void CreateForClosingStructures_CalculationWithOutputAndIllustrationPoints_ReturnEntityWithOutputAndIllustrationPoints() + { + // Setup + var calculation = new StructuresCalculation + { + Output = GetStructuresOutputWithIllustrationPoints() + }; + + var registry = new PersistenceRegistry(); + + // Call + ClosingStructuresCalculationEntity entity = calculation.CreateForClosingStructures(registry, 0); + + // Assert + ClosingStructuresOutputEntity outputEntity = entity.ClosingStructuresOutputEntities.FirstOrDefault(); + Assert.IsNotNull(outputEntity); + Assert.IsNotNull(outputEntity.GeneralResultFaultTreeIllustrationPointEntity); + } + #endregion #region CreateForStabilityPointStructures @@ -1228,6 +1284,26 @@ Assert.AreEqual(1, entity.StabilityPointStructuresOutputEntities.Count); } + [Test] + public void CreateForStabilityPointStructures_CalculationWithOutputAndIllustrationPoints_ReturnEntityWithOutputAndIllustrationPoints() + { + // Setup + var calculation = new StructuresCalculation + { + Output = GetStructuresOutputWithIllustrationPoints() + }; + + var registry = new PersistenceRegistry(); + + // Call + StabilityPointStructuresCalculationEntity entity = calculation.CreateForStabilityPointStructures(registry, 0); + + // Assert + StabilityPointStructuresOutputEntity outputEntity = entity.StabilityPointStructuresOutputEntities.FirstOrDefault(); + Assert.IsNotNull(outputEntity); + Assert.IsNotNull(outputEntity.GeneralResultFaultTreeIllustrationPointEntity); + } + #endregion } } \ No newline at end of file