public void GetLayerThickness_LayerInProfile_ReturnsThicknessOfLayer(int layerIndex, double expectedThickness) { // Setup var soilLayers = new[] { new MacroStabilityInwardsSoilLayer1D(0.0), new MacroStabilityInwardsSoilLayer1D(1.1) }; var profile = new MacroStabilityInwardsSoilProfile1D(string.Empty, 0.0, soilLayers); // Call double thickness = profile.GetLayerThickness(soilLayers[layerIndex]); // Assert Assert.AreEqual(expectedThickness, thickness); }
public void GetLayerThickness_LayerNotInProfile_ThrowsArgumentException() { // Setup var soilLayers = new[] { new MacroStabilityInwardsSoilLayer1D(0.0), new MacroStabilityInwardsSoilLayer1D(1.1) }; var profile = new MacroStabilityInwardsSoilProfile1D(string.Empty, 0.0, soilLayers); // Call void Call() => profile.GetLayerThickness(new MacroStabilityInwardsSoilLayer1D(1.1)); // Assert const string expectedMessage = "Layer not found in profile."; TestHelper.AssertThrowsArgumentExceptionAndTestMessage <ArgumentException>(Call, expectedMessage); }