public void ShouldThrowInvalidDataConversionExceptionIfNotTrueOrFalseValue() { // Arrange const string booleanString = "Not valid"; var converter = new BooleanToStringValueConverter { TrueValue = "Yes", FalseValue = "No" }; // Act & Assert Should.Throw <InvalidDataConversionException>(() => converter.ConvertBack(booleanString)); }
public void ShouldConvertToFalseWhenFalseValue() { // Arrange const string booleanString = "No"; const bool expected = false; var converter = new BooleanToStringValueConverter { TrueValue = "Yes", FalseValue = booleanString }; // Act bool converted = converter.ConvertBack(booleanString); // Assert converted.ShouldBe(expected); }