Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Update/MacrostabilityOutwardsFailureMechanismSectionResultUpdateExtensionsTest.cs =================================================================== diff -u -rb4816e19c7167c26fad825b88dd72b59dcedc13a -r3ef137de1d07bfecd17f0b415d895995d8b2d7b7 --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Update/MacrostabilityOutwardsFailureMechanismSectionResultUpdateExtensionsTest.cs (.../MacrostabilityOutwardsFailureMechanismSectionResultUpdateExtensionsTest.cs) (revision b4816e19c7167c26fad825b88dd72b59dcedc13a) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Update/MacrostabilityOutwardsFailureMechanismSectionResultUpdateExtensionsTest.cs (.../MacrostabilityOutwardsFailureMechanismSectionResultUpdateExtensionsTest.cs) (revision 3ef137de1d07bfecd17f0b415d895995d8b2d7b7) @@ -157,6 +157,41 @@ 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 MacrostabilityOutwardsFailureMechanismSectionResult(new TestFailureMechanismSection()) + { + StorageId = 1, + AssessmentLayerOne = true, + AssessmentLayerTwoA = (RoundedDouble)double.NaN, + AssessmentLayerThree = (RoundedDouble)double.NaN + }; + + var sectionResultEntity = new MacrostabilityOutwardsSectionResultEntity + { + MacrostabilityOutwardsSectionResultEntityId = sectionResult.StorageId, + LayerOne = Convert.ToByte(false), + LayerTwoA = 2.1m, + LayerThree = 1.1m, + }; + + ringtoetsEntities.MacrostabilityOutwardsSectionResultEntities.Add(sectionResultEntity); + + // Call + sectionResult.Update(new PersistenceRegistry(), ringtoetsEntities); + + // Assert + Assert.IsNull(sectionResultEntity.LayerTwoA); + Assert.IsNull(sectionResultEntity.LayerThree); + } } } \ No newline at end of file