Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Update/GrassCoverSlipOffOutwardsFailureMechanismSectionResultUpdateExtensionsTest.cs =================================================================== diff -u -r0e4717786f2f1a865e48da9fde2089a789bfe02c -r3ef137de1d07bfecd17f0b415d895995d8b2d7b7 --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Update/GrassCoverSlipOffOutwardsFailureMechanismSectionResultUpdateExtensionsTest.cs (.../GrassCoverSlipOffOutwardsFailureMechanismSectionResultUpdateExtensionsTest.cs) (revision 0e4717786f2f1a865e48da9fde2089a789bfe02c) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Update/GrassCoverSlipOffOutwardsFailureMechanismSectionResultUpdateExtensionsTest.cs (.../GrassCoverSlipOffOutwardsFailureMechanismSectionResultUpdateExtensionsTest.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 GrassCoverSlipOffOutwardsFailureMechanismSectionResult(new TestFailureMechanismSection()) + { + StorageId = 1, + AssessmentLayerOne = true, + AssessmentLayerThree = (RoundedDouble)double.NaN + }; + + var sectionResultEntity = new GrassCoverSlipOffOutwardsSectionResultEntity + { + GrassCoverSlipOffOutwardsSectionResultEntityId = sectionResult.StorageId, + LayerOne = Convert.ToByte(false), + LayerThree = 1.1m, + }; + + ringtoetsEntities.GrassCoverSlipOffOutwardsSectionResultEntities.Add(sectionResultEntity); + + // Call + sectionResult.Update(new PersistenceRegistry(), ringtoetsEntities); + + // Assert + Assert.IsNull(sectionResultEntity.LayerThree); + } } } \ No newline at end of file