Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Update/GrassCoverErosionOutwardsFailureMechanismSectionResultUpdateExtensionsTest.cs =================================================================== diff -u -r4a12b47ea94488f0716d7c61c6cefba235d7db48 -r3ef137de1d07bfecd17f0b415d895995d8b2d7b7 --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Update/GrassCoverErosionOutwardsFailureMechanismSectionResultUpdateExtensionsTest.cs (.../GrassCoverErosionOutwardsFailureMechanismSectionResultUpdateExtensionsTest.cs) (revision 4a12b47ea94488f0716d7c61c6cefba235d7db48) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Update/GrassCoverErosionOutwardsFailureMechanismSectionResultUpdateExtensionsTest.cs (.../GrassCoverErosionOutwardsFailureMechanismSectionResultUpdateExtensionsTest.cs) (revision 3ef137de1d07bfecd17f0b415d895995d8b2d7b7) @@ -158,6 +158,38 @@ Assert.AreEqual(sectionResult.AssessmentLayerThree.Value.ToNullableDecimal(), sectionResultEntity.LayerThree); mocks.VerifyAll(); - } + } + + [Test] + public void Create_WithNaNResult_ReturnsEntityWithNullResult() + { + // Setup + MockRepository mocks = new MockRepository(); + var ringtoetsEntities = RingtoetsEntitiesHelper.CreateStub(mocks); + + mocks.ReplayAll(); + + var sectionResult = new GrassCoverErosionOutwardsFailureMechanismSectionResult(new TestFailureMechanismSection()) + { + StorageId = 1, + AssessmentLayerOne = true, + AssessmentLayerThree = (RoundedDouble)double.NaN + }; + + var sectionResultEntity = new GrassCoverErosionOutwardsSectionResultEntity + { + GrassCoverErosionOutwardsSectionResultEntityId = sectionResult.StorageId, + LayerOne = Convert.ToByte(false), + LayerThree = 1.1m, + }; + + ringtoetsEntities.GrassCoverErosionOutwardsSectionResultEntities.Add(sectionResultEntity); + + // Call + sectionResult.Update(new PersistenceRegistry(), ringtoetsEntities); + + // Assert + Assert.IsNull(sectionResultEntity.LayerThree); + } } } \ No newline at end of file