Index: Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Primitives/MacroStabilityInwardsSoilLayer2D.cs =================================================================== diff -u -r9e9976818f1b446948c3bf815cafe2e023f98ac1 -r5d66a8b46b43830448e3bf8a3bf49a3bc3bbdb50 --- Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Primitives/MacroStabilityInwardsSoilLayer2D.cs (.../MacroStabilityInwardsSoilLayer2D.cs) (revision 9e9976818f1b446948c3bf815cafe2e023f98ac1) +++ Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Primitives/MacroStabilityInwardsSoilLayer2D.cs (.../MacroStabilityInwardsSoilLayer2D.cs) (revision 5d66a8b46b43830448e3bf8a3bf49a3bc3bbdb50) @@ -28,7 +28,7 @@ /// /// This class represents a 2D layer that was imported from D-Soil Model. /// - public class MacroStabilityInwardsSoilLayer2D : IMacroStabilityInwardsSoilLayer + public sealed class MacroStabilityInwardsSoilLayer2D : IMacroStabilityInwardsSoilLayer { /// /// Creates a new instance of . Index: Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.Primitives.Test/MacroStabilityInwardsSoilLayer2DTest.cs =================================================================== diff -u -r9e9976818f1b446948c3bf815cafe2e023f98ac1 -r5d66a8b46b43830448e3bf8a3bf49a3bc3bbdb50 --- Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.Primitives.Test/MacroStabilityInwardsSoilLayer2DTest.cs (.../MacroStabilityInwardsSoilLayer2DTest.cs) (revision 9e9976818f1b446948c3bf815cafe2e023f98ac1) +++ Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.Primitives.Test/MacroStabilityInwardsSoilLayer2DTest.cs (.../MacroStabilityInwardsSoilLayer2DTest.cs) (revision 5d66a8b46b43830448e3bf8a3bf49a3bc3bbdb50) @@ -36,23 +36,23 @@ public void Constructor_OuterRingNullWithoutDataAndNestedLayers_ThrowsArgumentNullException() { // Call - TestDelegate test = () => new MacroStabilityInwardsSoilLayer2D(null); + void Call() => new MacroStabilityInwardsSoilLayer2D(null); // Assert - var exception = Assert.Throws(test); + var exception = Assert.Throws(Call); Assert.AreEqual("outerRing", exception.ParamName); } [Test] public void Constructor_OuterRingNullWithDataAndNestedLayers_ThrowsArgumentNullException() { // Call - TestDelegate test = () => new MacroStabilityInwardsSoilLayer2D(null, - new MacroStabilityInwardsSoilLayerData(), - Enumerable.Empty()); + void Call() => new MacroStabilityInwardsSoilLayer2D(null, + new MacroStabilityInwardsSoilLayerData(), + Enumerable.Empty()); // Assert - var exception = Assert.Throws(test); + var exception = Assert.Throws(Call); Assert.AreEqual("outerRing", exception.ParamName); } @@ -63,10 +63,12 @@ Ring outerRing = RingTestFactory.CreateRandomRing(); // Call - TestDelegate test = () => new MacroStabilityInwardsSoilLayer2D(outerRing, null, Enumerable.Empty()); + void Call() => new MacroStabilityInwardsSoilLayer2D(outerRing, + null, + Enumerable.Empty()); // Assert - var exception = Assert.Throws(test); + var exception = Assert.Throws(Call); Assert.AreEqual("data", exception.ParamName); } @@ -77,10 +79,12 @@ Ring outerRing = RingTestFactory.CreateRandomRing(); // Call - TestDelegate test = () => new MacroStabilityInwardsSoilLayer2D(outerRing, new MacroStabilityInwardsSoilLayerData(), null); + void Call() => new MacroStabilityInwardsSoilLayer2D(outerRing, + new MacroStabilityInwardsSoilLayerData(), + null); // Assert - var exception = Assert.Throws(test); + var exception = Assert.Throws(Call); Assert.AreEqual("nestedLayers", exception.ParamName); } @@ -120,18 +124,13 @@ [TestFixture] private class MacroStabilityInwardsSoilLayer2DEqualsTest - : EqualsTestFixture + : EqualsTestFixture { protected override MacroStabilityInwardsSoilLayer2D CreateObject() { return CreateRandomLayer(21); } - protected override DerivedMacroStabilityInwardsSoilLayer2D CreateDerivedObject() - { - return new DerivedMacroStabilityInwardsSoilLayer2D(CreateRandomLayer(21)); - } - private static IEnumerable GetUnequalTestCases() { MacroStabilityInwardsSoilLayer2D baseLayer = CreateRandomLayer(21); @@ -176,11 +175,5 @@ }); } } - - private class DerivedMacroStabilityInwardsSoilLayer2D : MacroStabilityInwardsSoilLayer2D - { - public DerivedMacroStabilityInwardsSoilLayer2D(MacroStabilityInwardsSoilLayer2D layer) - : base(layer.OuterRing, layer.Data, layer.NestedLayers) {} - } } } \ No newline at end of file