Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Primitives.Test/MacroStabilityInwardsSoilLayer2DTest.cs =================================================================== diff -u -r686c5eeaad900a6bb627733de8c21bd607f130aa -r7078f0ab14bab4985d611c668d73267e3a37c8d0 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Primitives.Test/MacroStabilityInwardsSoilLayer2DTest.cs (.../MacroStabilityInwardsSoilLayer2DTest.cs) (revision 686c5eeaad900a6bb627733de8c21bd607f130aa) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Primitives.Test/MacroStabilityInwardsSoilLayer2DTest.cs (.../MacroStabilityInwardsSoilLayer2DTest.cs) (revision 7078f0ab14bab4985d611c668d73267e3a37c8d0) @@ -36,18 +36,8 @@ [Test] public void Constructor_OuterRingNullWithoutDataAndNestedLayers_ThrowsArgumentNullException() { - // Setup - var holes = new[] - { - new Ring(new[] - { - new Point2D(0, 2), - new Point2D(2, 2) - }) - }; - // Call - TestDelegate test = () => new MacroStabilityInwardsSoilLayer2D(null, holes); + TestDelegate test = () => new MacroStabilityInwardsSoilLayer2D(null); // Assert var exception = Assert.Throws(test); @@ -79,24 +69,6 @@ } [Test] - public void Constructor_HolesNullWithoutDataAndNestedLayers_ThrowsArgumentNullException() - { - // Setup - var outerRing = new Ring(new[] - { - new Point2D(0, 2), - new Point2D(2, 2) - }); - - // Call - TestDelegate test = () => new MacroStabilityInwardsSoilLayer2D(outerRing, null); - - // Assert - var exception = Assert.Throws(test); - Assert.AreEqual("holes", exception.ParamName); - } - - [Test] public void Constructor_HolesNullWithDataAndNestedLayers_ThrowsArgumentNullException() { // Setup @@ -156,24 +128,19 @@ } [Test] - public void Constructor_WithOuterRingAndHoles_ReturnsNewInstance() + public void Constructor_WithOuterRing_ReturnsNewInstance() { // Setup var random = new Random(39); Ring outerRing = CreateRandomRing(random); - var holes = new[] - { - CreateRandomRing(random) - }; // Call - var layer = new MacroStabilityInwardsSoilLayer2D(outerRing, holes); + var layer = new MacroStabilityInwardsSoilLayer2D(outerRing); // Assert Assert.IsInstanceOf(layer); Assert.AreSame(outerRing, layer.OuterRing); - Assert.AreNotSame(holes, layer.Holes); - TestHelper.AssertCollectionsAreEqual(holes, layer.Holes, new ReferenceEqualityComparer()); + CollectionAssert.IsEmpty(layer.Holes); Assert.IsNotNull(layer.Data); Assert.IsEmpty(layer.NestedLayers); } @@ -267,52 +234,51 @@ var layerE = new MacroStabilityInwardsSoilLayer2D( CreateRandomRing(new Random(21)), - new[] + Enumerable.Empty(), + new MacroStabilityInwardsSoilLayerData { - CreateRandomRing(new Random(22)) - }) - { - Data = - { Color = Color.Blue - } - }; + }, + new[] + { + new MacroStabilityInwardsSoilLayer2D(CreateRandomRing(new Random(22))) + }); + var layerF = new MacroStabilityInwardsSoilLayer2D( CreateRandomRing(new Random(31)), - new[] + Enumerable.Empty(), + new MacroStabilityInwardsSoilLayerData { - CreateRandomRing(new Random(22)) - }) - { - Data = - { Color = Color.Blue - } - }; + }, + new[] + { + new MacroStabilityInwardsSoilLayer2D(CreateRandomRing(new Random(22))) + }); + var layerG = new MacroStabilityInwardsSoilLayer2D( CreateRandomRing(new Random(21)), - new[] + Enumerable.Empty(), + new MacroStabilityInwardsSoilLayerData { - CreateRandomRing(new Random(32)) - }) - { - Data = - { Color = Color.Blue - } - }; + }, + new[] + { + new MacroStabilityInwardsSoilLayer2D(CreateRandomRing(new Random(32))) + }); + var layerH = new MacroStabilityInwardsSoilLayer2D( CreateRandomRing(new Random(21)), - new[] + Enumerable.Empty(), + new MacroStabilityInwardsSoilLayerData { - CreateRandomRing(new Random(22)) - }) - { - Data = - { Color = Color.Gold - } - }; + }, + new[] + { + new MacroStabilityInwardsSoilLayer2D(CreateRandomRing(new Random(22))) + }); return new[] { @@ -362,16 +328,17 @@ private static MacroStabilityInwardsSoilLayer2D CreateRandomLayer(int randomSeed) { var random = new Random(randomSeed); - return new MacroStabilityInwardsSoilLayer2D(CreateRandomRing(random), new[] - { - CreateRandomRing(random) - }) - { - Data = - { - Color = Color.FromKnownColor(random.NextEnumValue()) - } - }; + + return new MacroStabilityInwardsSoilLayer2D(CreateRandomRing(random), + Enumerable.Empty(), + new MacroStabilityInwardsSoilLayerData + { + Color = Color.FromKnownColor(random.NextEnumValue()) + }, + new[] + { + new MacroStabilityInwardsSoilLayer2D(CreateRandomRing(random)) + }); } private static Ring CreateRandomRing(Random random)