public void ConvertFrom_InvalidText_ThrowNotSupportedException() { // Setup var converter = new ConfigurationBreakWaterTypeConverter(); // Call TestDelegate call = () => converter.ConvertFrom("A"); // Assert Assert.Throws <NotSupportedException>(call); }
public void ConvertFrom_BreakWaterType_ReturnExpectedBreakWaterType(BreakWaterType value, ConfigurationBreakWaterType expectedResult) { // Setup var converter = new ConfigurationBreakWaterTypeConverter(); // Call object result = converter.ConvertFrom(value); // Assert Assert.AreEqual(expectedResult, result); }
public void ConvertFrom_InvalidClosingStructureInflowModelType_ThrowInvalidEnumArgumentException() { // Setup const int invalidValue = -1; var converter = new ConfigurationBreakWaterTypeConverter(); // Call TestDelegate call = () => converter.ConvertFrom((BreakWaterType)invalidValue); // Assert string expectedMessage = $"The value of argument 'value' ({invalidValue}) is invalid for Enum type '{nameof(BreakWaterType)}'."; string parameterName = TestHelper.AssertThrowsArgumentExceptionAndTestMessage <InvalidEnumArgumentException>(call, expectedMessage).ParamName; Assert.AreEqual("value", parameterName); }