Index: Ringtoets/Common/src/Ringtoets.Common.Data/UpdateDataStrategies/UpdateDataStrategyBase.cs =================================================================== diff -u -r501642521ffd0016f8f8c1d1b618395c4898612b -re9a40c653a63e31757bf87930745200f9c22cb2e --- Ringtoets/Common/src/Ringtoets.Common.Data/UpdateDataStrategies/UpdateDataStrategyBase.cs (.../UpdateDataStrategyBase.cs) (revision 501642521ffd0016f8f8c1d1b618395c4898612b) +++ Ringtoets/Common/src/Ringtoets.Common.Data/UpdateDataStrategies/UpdateDataStrategyBase.cs (.../UpdateDataStrategyBase.cs) (revision e9a40c653a63e31757bf87930745200f9c22cb2e) @@ -44,7 +44,7 @@ where TFeature : class where TFailureMechanism : IFailureMechanism { - protected TFailureMechanism failureMechanism; + protected readonly TFailureMechanism failureMechanism; private readonly IEqualityComparer equalityComparer; /// Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PresentationObjects/SelectableHydraulicBoundaryLocationTest.cs =================================================================== diff -u -rac582bc093c8a275cd9b5dc2148af313b5242062 -re9a40c653a63e31757bf87930745200f9c22cb2e --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PresentationObjects/SelectableHydraulicBoundaryLocationTest.cs (.../SelectableHydraulicBoundaryLocationTest.cs) (revision ac582bc093c8a275cd9b5dc2148af313b5242062) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PresentationObjects/SelectableHydraulicBoundaryLocationTest.cs (.../SelectableHydraulicBoundaryLocationTest.cs) (revision e9a40c653a63e31757bf87930745200f9c22cb2e) @@ -32,7 +32,7 @@ public class SelectableHydraulicBoundaryLocationTest { [Test] - [TestCaseSource("ReferencePointLocations")] + [TestCaseSource(nameof(ReferencePointLocations))] public void Constructor_ArgumentsNotNull_ReturnsRightData(Point2D referencePoint, double expectedDistance) { // Setup @@ -76,7 +76,7 @@ } [Test] - [TestCaseSource("EqualityReferencePoints")] + [TestCaseSource(nameof(EqualityReferencePoints))] public void Equals_ToOtherWithSameHydraulicBoundaryLocationsAndVaryingReferencePoints_ReturnsTrue(Point2D referencePoint1, Point2D referencePoint2) { @@ -95,7 +95,7 @@ } [Test] - [TestCaseSource("EqualityReferencePoints")] + [TestCaseSource(nameof(EqualityReferencePoints))] public void Equals_ToOtherWithDifferentHydraulicBoundaryLocationsAndVaryingReferencePoints_ReturnsTrue(Point2D referencePoint1, Point2D referencePoint2) { @@ -190,7 +190,7 @@ } [Test] - [TestCaseSource("EqualityReferencePoints")] + [TestCaseSource(nameof(EqualityReferencePoints))] public void GetHashCode_EqualObjects_ReturnsSameHashCode(Point2D referencePoint1, Point2D referencePoint2) { @@ -211,7 +211,7 @@ } [Test] - [TestCaseSource("EqualityReferencePoints")] + [TestCaseSource(nameof(EqualityReferencePoints))] public void GetHashCode_NotEqualObjects_ReturnsDifferenHashCode(Point2D referencePoint1, Point2D referencePoint2) { @@ -233,7 +233,7 @@ } [Test] - [TestCaseSource("StringRepresentations")] + [TestCaseSource(nameof(StringRepresentations))] public void ToString_DifferentReferencePoints_ReturnsExpectedString(HydraulicBoundaryLocation location, Point2D referencePoint, string expectedString) { Index: Ringtoets/Piping/src/Ringtoets.Piping.Plugin/FileImporter/RingtoetsPipingSurfaceLineUpdateStrategy.cs =================================================================== diff -u -r501642521ffd0016f8f8c1d1b618395c4898612b -re9a40c653a63e31757bf87930745200f9c22cb2e --- Ringtoets/Piping/src/Ringtoets.Piping.Plugin/FileImporter/RingtoetsPipingSurfaceLineUpdateStrategy.cs (.../RingtoetsPipingSurfaceLineUpdateStrategy.cs) (revision 501642521ffd0016f8f8c1d1b618395c4898612b) +++ Ringtoets/Piping/src/Ringtoets.Piping.Plugin/FileImporter/RingtoetsPipingSurfaceLineUpdateStrategy.cs (.../RingtoetsPipingSurfaceLineUpdateStrategy.cs) (revision e9a40c653a63e31757bf87930745200f9c22cb2e) @@ -24,6 +24,7 @@ using System.Linq; using Core.Common.Base; using Ringtoets.Common.Data.UpdateDataStrategies; +using Ringtoets.Common.Service; using Ringtoets.Piping.Data; using Ringtoets.Piping.Forms; using Ringtoets.Piping.IO.Importers; @@ -101,33 +102,46 @@ foreach (RingtoetsPipingSurfaceLine updatedSurfaceLine in objectsToUpdate) { RingtoetsPipingSurfaceLine matchingSurfaceLine = importedDataCollection.Single(sl => sl.Name == updatedSurfaceLine.Name); - updatedSurfaceLine.Update(matchingSurfaceLine); - affectedObjects.Add(updatedSurfaceLine); - affectedObjects.AddRange(UpdateAvailableStochasticSoilModels(updatedSurfaceLine)); + if (!updatedSurfaceLine.Equals(matchingSurfaceLine)) + { + updatedSurfaceLine.Update(matchingSurfaceLine); + affectedObjects.Add(updatedSurfaceLine); + + affectedObjects.AddRange(UpdateAffectedCalculations(updatedSurfaceLine)); + } } return affectedObjects; } - private IEnumerable UpdateAvailableStochasticSoilModels(RingtoetsPipingSurfaceLine updatedSurfaceLine) + private IEnumerable UpdateAffectedCalculations(RingtoetsPipingSurfaceLine surfaceLine) { IEnumerable affectedCalculations = failureMechanism.Calculations .Cast() - .Where(calc => ReferenceEquals(updatedSurfaceLine, calc.InputParameters.SurfaceLine)); + .Where(calc => ReferenceEquals(calc.InputParameters.SurfaceLine, surfaceLine)); var affectedObjects = new List(); foreach (PipingCalculation affectedCalculation in affectedCalculations) { - IEnumerable matchingSoilModels = GetAvailableStochasticSoilModels(updatedSurfaceLine); - PipingInputService.SetMatchingStochasticSoilModel(affectedCalculation.InputParameters, matchingSoilModels); - affectedObjects.Add(affectedCalculation); - affectedObjects.Add(affectedCalculation.InputParameters); + affectedObjects.AddRange(RingtoetsCommonDataSynchronizationService.ClearCalculationOutput(affectedCalculation)); + affectedObjects.AddRange(UpdateStochasticSoilModel(surfaceLine, affectedCalculation.InputParameters)); } return affectedObjects; } + private IEnumerable UpdateStochasticSoilModel(RingtoetsPipingSurfaceLine updatedSurfaceLine, PipingInput pipingInput) + { + IEnumerable matchingSoilModels = GetAvailableStochasticSoilModels(updatedSurfaceLine); + PipingInputService.SetMatchingStochasticSoilModel(pipingInput, matchingSoilModels); + + return new[] + { + pipingInput + }; + } + private IEnumerable GetAvailableStochasticSoilModels(RingtoetsPipingSurfaceLine surfaceLine) { return PipingCalculationConfigurationHelper.GetStochasticSoilModelsForSurfaceLine(surfaceLine, Index: Ringtoets/Piping/src/Ringtoets.Piping.Primitives/RingtoetsPipingSurfaceLine.cs =================================================================== diff -u -r18e230605af8cda1d527525691b2ba9597bf1464 -re9a40c653a63e31757bf87930745200f9c22cb2e --- Ringtoets/Piping/src/Ringtoets.Piping.Primitives/RingtoetsPipingSurfaceLine.cs (.../RingtoetsPipingSurfaceLine.cs) (revision 18e230605af8cda1d527525691b2ba9597bf1464) +++ Ringtoets/Piping/src/Ringtoets.Piping.Primitives/RingtoetsPipingSurfaceLine.cs (.../RingtoetsPipingSurfaceLine.cs) (revision e9a40c653a63e31757bf87930745200f9c22cb2e) @@ -371,6 +371,62 @@ SetGeometry(fromSurfaceLine.Points); } + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) + { + return false; + } + if (ReferenceEquals(this, obj)) + { + return true; + } + if (obj.GetType() != GetType()) + { + return false; + } + return Equals((RingtoetsPipingSurfaceLine) obj); + } + + public override int GetHashCode() + { + unchecked + { + int hashCode = Name.GetHashCode(); + foreach (Point3D point in Points) + { + hashCode = (hashCode * 397) ^ point.GetHashCode(); + } + return hashCode; + } + } + + private bool Equals(RingtoetsPipingSurfaceLine other) + { + return string.Equals(Name, other.Name) + && EqualPoints(other.Points); + } + + private bool EqualPoints(Point3D[] otherPoints) + { + int nrOfOtherPoints = otherPoints.Length; + if (Points.Length != nrOfOtherPoints) + { + return false; + } + + int i = 0; + foreach (Point3D point in Points) + { + if (!point.Equals(otherPoints[i])) + { + return false; + } + i++; + } + return true; + } + public override string ToString() { return Name; Index: Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/RingtoetsPipingSurfaceLineTest.cs =================================================================== diff -u -r18e230605af8cda1d527525691b2ba9597bf1464 -re9a40c653a63e31757bf87930745200f9c22cb2e --- Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/RingtoetsPipingSurfaceLineTest.cs (.../RingtoetsPipingSurfaceLineTest.cs) (revision 18e230605af8cda1d527525691b2ba9597bf1464) +++ Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/RingtoetsPipingSurfaceLineTest.cs (.../RingtoetsPipingSurfaceLineTest.cs) (revision e9a40c653a63e31757bf87930745200f9c22cb2e) @@ -768,6 +768,258 @@ CollectionAssert.AreEqual(expectedGeometry, surfaceLine.Points); } + [Test] + public void Equals_ToItself_ReturnsTrue() + { + // Setup + var surfaceLineOne = new RingtoetsPipingSurfaceLine(); + + // Call + bool isLineOneEqualToLineOne = surfaceLineOne.Equals(surfaceLineOne); + + // Assert + Assert.IsTrue(isLineOneEqualToLineOne); + } + + [Test] + public void Equal_SameReference_ReturnsTrue() + { + // Setup + var surfaceLineOne = new RingtoetsPipingSurfaceLine(); + var surfaceLineTwo = surfaceLineOne; + + // Call + bool isLineOneEqualToLineTwo = surfaceLineOne.Equals(surfaceLineTwo); + bool isLineTwoEqualToLineOne = surfaceLineTwo.Equals(surfaceLineOne); + + // Assert + Assert.IsTrue(isLineOneEqualToLineTwo); + Assert.IsTrue(isLineTwoEqualToLineOne); + } + + [Test] + public void Equals_ToNull_ReturnsFalse() + { + // Setup + var surfaceLineOne = new RingtoetsPipingSurfaceLine + { + Name = "Name A" + }; + + // Call + bool isLineOneEqualToNull = surfaceLineOne.Equals(null); + + // Assert + Assert.IsFalse(isLineOneEqualToNull); + } + + [Test] + public void Equals_ToDifferentType_ReturnsFalse() + { + // Setup + var surfaceLineOne = new RingtoetsPipingSurfaceLine + { + Name = "Name A" + }; + + var differentType = new object(); + + // Call + bool isSurfaceLineEqualToDifferentType = surfaceLineOne.Equals(differentType); + bool isDifferentTypeEqualToSurfaceLine = differentType.Equals(surfaceLineOne); + + // Assert + Assert.IsFalse(isSurfaceLineEqualToDifferentType); + Assert.IsFalse(isDifferentTypeEqualToSurfaceLine); + } + + [Test] + public void Equals_DifferentNames_ReturnsFalse() + { + // Setup + var surfaceLineOne = new RingtoetsPipingSurfaceLine + { + Name = "Name A" + }; + + var surfaceLineTwo = new RingtoetsPipingSurfaceLine + { + Name = "Name B" + }; + + // Call + bool isLineOneEqualToLineTwo = surfaceLineOne.Equals(surfaceLineTwo); + bool isLineTwoEqualToLineOne = surfaceLineTwo.Equals(surfaceLineOne); + + // Assert + Assert.IsFalse(isLineOneEqualToLineTwo); + Assert.IsFalse(isLineTwoEqualToLineOne); + } + + [Test] + public void Equals_DifferentGeometries_ReturnsFalse() + { + // Setup + var surfaceLineOne = new RingtoetsPipingSurfaceLine + { + Name = "Name A" + }; + surfaceLineOne.SetGeometry(new[] + { + new Point3D(1, 2, 3) + }); + + var surfaceLineTwo = new RingtoetsPipingSurfaceLine + { + Name = "Name A" + }; + surfaceLineTwo.SetGeometry(new[] + { + new Point3D(3, 4, 5) + }); + + // Call + bool isLineOneEqualToLineTwo = surfaceLineOne.Equals(surfaceLineTwo); + bool isLineTwoEqualToLineOne = surfaceLineTwo.Equals(surfaceLineOne); + + // Assert + Assert.IsFalse(isLineOneEqualToLineTwo); + Assert.IsFalse(isLineTwoEqualToLineOne); + } + + [Test] + public void Equals_NamesAndGeometriesEqual_ReturnsTrue() + { + // Setup + var surfaceLineOne = new RingtoetsPipingSurfaceLine + { + Name = "Name A" + }; + surfaceLineOne.SetGeometry(new[] + { + new Point3D(1, 2, 3) + }); + + var surfaceLineTwo = new RingtoetsPipingSurfaceLine + { + Name = "Name A" + }; + surfaceLineTwo.SetGeometry(new[] + { + new Point3D(1, 2, 3) + }); + + // Call + bool isLineOneEqualToLineTwo = surfaceLineOne.Equals(surfaceLineTwo); + bool isLineTwoEqualToLineOne = surfaceLineTwo.Equals(surfaceLineOne); + + // Assert + Assert.IsTrue(isLineOneEqualToLineTwo); + Assert.IsTrue(isLineTwoEqualToLineOne); + } + + [Test] + public void Equals_TransitivePropertyWithSameNamesAndGeometry_ReturnsTrue() + { + // Setup + var surfaceLineOne = new RingtoetsPipingSurfaceLine + { + Name = "Name A" + }; + surfaceLineOne.SetGeometry(new[] + { + new Point3D(1, 2, 3) + }); + + var surfaceLineTwo = new RingtoetsPipingSurfaceLine + { + Name = "Name A" + }; + surfaceLineTwo.SetGeometry(new[] + { + new Point3D(1, 2, 3) + }); + + var surfaceLineThree = new RingtoetsPipingSurfaceLine + { + Name = "Name A" + }; + surfaceLineThree.SetGeometry(new[] + { + new Point3D(1, 2, 3) + }); + + // Call + bool isLineOneEqualToLineTwo = surfaceLineOne.Equals(surfaceLineTwo); + bool isLineTwoEqualToLineThree = surfaceLineTwo.Equals(surfaceLineThree); + bool isLineOneEqualToLineThree = surfaceLineOne.Equals(surfaceLineThree); + + // Assert + Assert.IsTrue(isLineOneEqualToLineTwo); + Assert.IsTrue(isLineTwoEqualToLineThree); + Assert.IsTrue(isLineOneEqualToLineThree); + } + + [Test] + public void GetHashCode_EqualSurfaceLines_ReturnSameHashCode() + { + // Setup + var surfaceLineOne = new RingtoetsPipingSurfaceLine + { + Name = "Name A" + }; + surfaceLineOne.SetGeometry(new[] + { + new Point3D(1, 2, 3) + }); + + var surfaceLineTwo = new RingtoetsPipingSurfaceLine + { + Name = "Name A" + }; + surfaceLineTwo.SetGeometry(new[] + { + new Point3D(1, 2, 3) + }); + + // Call + int hashCodeOne = surfaceLineOne.GetHashCode(); + int hashCodeTwo = surfaceLineTwo.GetHashCode(); + + // Assert + Assert.AreEqual(hashCodeOne, hashCodeTwo); + } + + [Test] + public void GetHashCode_DifferentSurfaceLines_ReturnDifferentHashCode() + { + // Setup + var surfaceLineOne = new RingtoetsPipingSurfaceLine + { + Name = "Name A" + }; + surfaceLineOne.SetGeometry(new[] + { + new Point3D(1, 2, 3) + }); + + var surfaceLineTwo = new RingtoetsPipingSurfaceLine + { + Name = "Name A" + }; + surfaceLineTwo.SetGeometry(new[] + { + new Point3D(3, 4, 5) + }); + + // Call + int hashCodeOne = surfaceLineOne.GetHashCode(); + int hashCodeTwo = surfaceLineTwo.GetHashCode(); + + // Assert + Assert.AreNotEqual(hashCodeOne, hashCodeTwo); + } + private static void CreateTestGeometry(Point3D testPoint, RingtoetsPipingSurfaceLine surfaceLine) { var random = new Random(21); Index: Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/FileImporter/RingtoetsPipingSurfaceLineUpdateDataStrategyTest.cs =================================================================== diff -u -r157d5c598ec416ce7989b0da4ba54f4f1e5d8b47 -re9a40c653a63e31757bf87930745200f9c22cb2e --- Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/FileImporter/RingtoetsPipingSurfaceLineUpdateDataStrategyTest.cs (.../RingtoetsPipingSurfaceLineUpdateDataStrategyTest.cs) (revision 157d5c598ec416ce7989b0da4ba54f4f1e5d8b47) +++ Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/FileImporter/RingtoetsPipingSurfaceLineUpdateDataStrategyTest.cs (.../RingtoetsPipingSurfaceLineUpdateDataStrategyTest.cs) (revision e9a40c653a63e31757bf87930745200f9c22cb2e) @@ -27,7 +27,9 @@ using NUnit.Framework; using Ringtoets.Common.Data.UpdateDataStrategies; using Ringtoets.Piping.Data; +using Ringtoets.Piping.Data.TestUtil; using Ringtoets.Piping.IO.Importers; +using Ringtoets.Piping.KernelWrapper.TestUtil; using Ringtoets.Piping.Plugin.FileImporter; using Ringtoets.Piping.Primitives; @@ -315,6 +317,142 @@ } [Test] + public void UpdateSurfaceLinesWithImportedData_CalculationWithOutputAndAssignedLineDeleted_ClearsCalculationOutput() + { + // Setup + RingtoetsPipingSurfaceLine surfaceLine = CreateValidSurfaceLineForCalculations(); + var calculation = new PipingCalculation(new GeneralPipingInput()) + { + InputParameters = + { + SurfaceLine = surfaceLine + }, + Output = new TestPipingOutput(), + SemiProbabilisticOutput = new TestPipingSemiProbabilisticOutput() + }; + + var failureMechanism = new PipingFailureMechanism(); + failureMechanism.CalculationsGroup.Children.Add(calculation); + + var strategy = new RingtoetsPipingSurfaceLineUpdateDataStrategy(failureMechanism); + + var collection = new RingtoetsPipingSurfaceLineCollection(); + collection.AddRange(new[] + { + surfaceLine + }, sourceFilePath); + + // Call + IEnumerable affectedObjects = strategy.UpdateSurfaceLinesWithImportedData(collection, + Enumerable.Empty(), + sourceFilePath).ToArray(); + + // Assert + Assert.IsFalse(calculation.HasOutput); + Assert.IsNull(calculation.InputParameters.SurfaceLine); + CollectionAssert.Contains(affectedObjects, calculation); + CollectionAssert.Contains(affectedObjects, calculation.InputParameters); + } + + [Test] + public void UpdateSurfaceLinesWithImportedData_MultipleCalculationsWithSurfaceLines_OnlyUpdatesCalculationWithUpdatedSurfaceLine() + { + // Setup + var affectedSurfaceLine = new RingtoetsPipingSurfaceLine + { + Name = "Name A" + }; + affectedSurfaceLine.SetGeometry(new[] + { + new Point3D(1, 2, 3), + new Point3D(4, 5, 6) + }); + var affectedCalculation = new PipingCalculation(new GeneralPipingInput()) + { + InputParameters = + { + SurfaceLine = affectedSurfaceLine + }, + Output = new TestPipingOutput(), + SemiProbabilisticOutput = new TestPipingSemiProbabilisticOutput() + }; + + var unaffectedGeometry = new[] + { + new Point3D(10, 9, 8), + new Point3D(7, 6, 5) + }; + var unaffectedSurfaceLine = new RingtoetsPipingSurfaceLine() + { + Name = "Name B" + }; + unaffectedSurfaceLine.SetGeometry(unaffectedGeometry); + var unAffectedCalculation = new PipingCalculation(new GeneralPipingInput()) + { + InputParameters = + { + SurfaceLine = unaffectedSurfaceLine + }, + Output = new TestPipingOutput(), + SemiProbabilisticOutput = new TestPipingSemiProbabilisticOutput() + }; + + var collection = new RingtoetsPipingSurfaceLineCollection(); + collection.AddRange(new[] + { + affectedSurfaceLine, + unaffectedSurfaceLine + }, sourceFilePath); + + var failureMechanism = new PipingFailureMechanism(); + failureMechanism.CalculationsGroup.Children.Add(affectedCalculation); + failureMechanism.CalculationsGroup.Children.Add(unAffectedCalculation); + + var importedAffectedSurfaceLine = new RingtoetsPipingSurfaceLine + { + Name = "Name A" + }; + importedAffectedSurfaceLine.SetGeometry(new[] + { + new Point3D(0, 0, 0), + new Point3D(10, 0, 0) + }); + var importedUnaffectedSurfaceLine = new RingtoetsPipingSurfaceLine + { + Name = "Name B" + }; + importedUnaffectedSurfaceLine.SetGeometry(unaffectedGeometry); + + var strategy = new RingtoetsPipingSurfaceLineUpdateDataStrategy(failureMechanism); + + // Call + IEnumerable affectedObjects = strategy.UpdateSurfaceLinesWithImportedData(collection, + new[] + { + importedAffectedSurfaceLine, + importedUnaffectedSurfaceLine + }, "path").ToArray(); + + // Assert + Assert.IsTrue(unAffectedCalculation.HasOutput); + PipingInput unaffectedInput = unAffectedCalculation.InputParameters; + Assert.AreSame(unaffectedSurfaceLine, unaffectedInput.SurfaceLine); + CollectionAssert.AreEqual(unaffectedGeometry, unaffectedSurfaceLine.Points); + + Assert.IsFalse(affectedCalculation.HasOutput); + PipingInput affectedInput = affectedCalculation.InputParameters; + Assert.AreSame(affectedSurfaceLine, affectedInput.SurfaceLine); + CollectionAssert.AreEqual(importedAffectedSurfaceLine.Points, affectedSurfaceLine.Points); + + CollectionAssert.AreEquivalent(new IObservable[] + { + affectedCalculation, + affectedInput, + affectedSurfaceLine + }, affectedObjects); + } + + [Test] public void UpdateSurfaceLinesWithImportedData_WithCalculationAssignedToUpdatedLine_UpdatesCalculationAndStochasticSoilModel() { // Setup @@ -384,7 +522,6 @@ // Assert PipingInput calculationInput = calculation.InputParameters; - CollectionAssert.Contains(affectedObjects, calculation); CollectionAssert.Contains(affectedObjects, calculationInput); Assert.AreSame(surfaceLine, calculationInput.SurfaceLine); CollectionAssert.AreEqual(importedSurfaceLine.Points, surfaceLine.Points); @@ -474,7 +611,6 @@ // Assert PipingInput calculationInput = calculation.InputParameters; - CollectionAssert.Contains(affectedObjects, calculation); CollectionAssert.Contains(affectedObjects, calculationInput); Assert.AreSame(surfaceLine, calculationInput.SurfaceLine); CollectionAssert.AreEqual(importedSurfaceLine.Points, surfaceLine.Points); @@ -576,14 +712,12 @@ // Assert PipingInput unaffectedInput = unAffectedCalculation.InputParameters; - CollectionAssert.DoesNotContain(affectedObjects, unAffectedCalculation); CollectionAssert.DoesNotContain(affectedObjects, unaffectedInput); Assert.AreSame(unaffectedSurfaceLine, unaffectedInput.SurfaceLine); CollectionAssert.AreEqual(unaffectedGeometry, unaffectedSurfaceLine.Points); Assert.IsNull(unaffectedInput.StochasticSoilModel); PipingInput affectedInput = affectedCalculation.InputParameters; - CollectionAssert.Contains(affectedObjects, affectedCalculation); CollectionAssert.Contains(affectedObjects, affectedInput); Assert.AreSame(affectedSurfaceLine, affectedInput.SurfaceLine); CollectionAssert.AreEqual(importedSurfaceLine.Points, affectedSurfaceLine.Points);