Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/HydraulicBoundaryLocationCalculationCreateExtensionsTest.cs =================================================================== diff -u -r87b871f1ce03d1909e2402890a01154c5d9b797b -rc09f98eb4d96d7b5e5efe5029970f0d2ff2f87d2 --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/HydraulicBoundaryLocationCalculationCreateExtensionsTest.cs (.../HydraulicBoundaryLocationCalculationCreateExtensionsTest.cs) (revision 87b871f1ce03d1909e2402890a01154c5d9b797b) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/HydraulicBoundaryLocationCalculationCreateExtensionsTest.cs (.../HydraulicBoundaryLocationCalculationCreateExtensionsTest.cs) (revision c09f98eb4d96d7b5e5efe5029970f0d2ff2f87d2) @@ -26,7 +26,7 @@ using Core.Common.TestUtil; using NUnit.Framework; using Ringtoets.Common.Data.Hydraulics; -using Ringtoets.Common.Data.TestUtil; +using Ringtoets.Common.Data.TestUtil.IllustrationPoints; namespace Application.Ringtoets.Storage.Test { @@ -69,7 +69,7 @@ } [Test] - public void Create_CalculationWithOutput_ReturnsHydraulicLocationCalculationEntityWithOutput() + public void Create_CalculationWithOutputAndWithoutGeneralResult_ReturnsHydraulicLocationCalculationEntityWithOutput() { // Setup var random = new Random(33); @@ -80,7 +80,10 @@ { ShouldIllustrationPointsBeCalculated = shouldIllustrationPointsBeCalculated }, - Output = new TestHydraulicBoundaryLocationOutput(random.NextDouble()) + Output = new HydraulicBoundaryLocationOutput( + random.NextDouble(), random.NextDouble(), random.NextDouble(), random.NextDouble(), + random.NextDouble(), random.NextEnumValue(), + null) }; // Call @@ -94,6 +97,35 @@ AssertHydraulicLocationOutput(calculation.Output, outputEntity); } + [Test] + public void Create_CalculationWithOutputAndGeneralResult_ReturnsHydraulicLocationCalculationEntityWithOutput() + { + // Setup + var random = new Random(33); + bool shouldIllustrationPointsBeCalculated = random.NextBoolean(); + var calculation = new HydraulicBoundaryLocationCalculation + { + InputParameters = + { + ShouldIllustrationPointsBeCalculated = shouldIllustrationPointsBeCalculated + }, + Output = new HydraulicBoundaryLocationOutput( + random.NextDouble(), random.NextDouble(), random.NextDouble(), random.NextDouble(), + random.NextDouble(), random.NextEnumValue(), + new TestGeneralResultSubMechanismIllustrationPoint()) + }; + + // Call + HydraulicLocationCalculationEntity entity = calculation.Create(); + + // Assert + Assert.IsNotNull(entity); + Assert.AreEqual(Convert.ToByte(shouldIllustrationPointsBeCalculated), entity.ShouldIllustrationPointsBeCalculated); + + HydraulicLocationOutputEntity outputEntity = entity.HydraulicLocationOutputEntities.Single(); + AssertHydraulicLocationOutput(calculation.Output, outputEntity); + } + private static void AssertHydraulicLocationOutput(HydraulicBoundaryLocationOutput expectedOutput, HydraulicLocationOutputEntity actualOutput) {