Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/MacrostabilityInwards/MacrostabilityInwardsFailureMechanismCreateExtensionsTest.cs =================================================================== diff -u -re42bdf3dd379c46bab9212eb7b30f4754c9bc91c -r8e310b99d8873ca1a46282c54302acb1d1678dab --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/MacrostabilityInwards/MacrostabilityInwardsFailureMechanismCreateExtensionsTest.cs (.../MacrostabilityInwardsFailureMechanismCreateExtensionsTest.cs) (revision e42bdf3dd379c46bab9212eb7b30f4754c9bc91c) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/MacrostabilityInwards/MacrostabilityInwardsFailureMechanismCreateExtensionsTest.cs (.../MacrostabilityInwardsFailureMechanismCreateExtensionsTest.cs) (revision 8e310b99d8873ca1a46282c54302acb1d1678dab) @@ -56,7 +56,18 @@ var failureMechanism = new MacrostabilityInwardsFailureMechanism { IsRelevant = isRelevant, - Comments = "Some text" + InputComments = + { + Comments = "Some input text" + }, + OutputComments = + { + Comments = "Some output text" + }, + NotRelevantComments = + { + Comments = "Really not relevant" + } }; var registry = new PersistenceRegistry(); @@ -67,27 +78,48 @@ Assert.IsNotNull(entity); Assert.AreEqual((short) FailureMechanismType.MacrostabilityInwards, entity.FailureMechanismType); Assert.AreEqual(Convert.ToByte(isRelevant), entity.IsRelevant); - Assert.AreEqual(failureMechanism.Comments, entity.Comments); + Assert.AreEqual(failureMechanism.InputComments.Comments, entity.InputComments); + Assert.AreEqual(failureMechanism.OutputComments.Comments, entity.OutputComments); + Assert.AreEqual(failureMechanism.NotRelevantComments.Comments, entity.NotRelevantComments); } [Test] public void Create_StringPropertiesDoNotShareReference() { // Setup - const string originalComments = "Some text"; + const string originalInput = "Some input text"; + const string originalOutput = "Some output text"; + const string originalNotRelevantText = "Really not relevant"; var failureMechanism = new MacrostabilityInwardsFailureMechanism { - Comments = originalComments + InputComments = + { + Comments = originalInput + }, + OutputComments = + { + Comments = originalOutput + }, + NotRelevantComments = + { + Comments = originalNotRelevantText + } }; var registry = new PersistenceRegistry(); // Call FailureMechanismEntity entity = failureMechanism.Create(registry); // Assert - Assert.AreNotSame(originalComments, entity.Comments, + Assert.AreNotSame(originalInput, entity.InputComments, "To create stable binary representations/fingerprints, it's really important that strings are not shared."); - Assert.AreEqual(originalComments, entity.Comments); + Assert.AreEqual(failureMechanism.InputComments.Comments, entity.InputComments); + Assert.AreNotSame(originalOutput, entity.OutputComments, + "To create stable binary representations/fingerprints, it's really important that strings are not shared."); + Assert.AreEqual(failureMechanism.OutputComments.Comments, entity.OutputComments); + Assert.AreNotSame(originalNotRelevantText, entity.NotRelevantComments, + "To create stable binary representations/fingerprints, it's really important that strings are not shared."); + Assert.AreEqual(failureMechanism.NotRelevantComments.Comments, entity.NotRelevantComments); } [Test]