public void FormatValue_should_format_boolean() { var attribute = new FormatBooleanAttribute("on", "off"); Assert.That(attribute.FormatValue(true, _formattingService), Is.EqualTo("on")); Assert.That(attribute.FormatValue(false, _formattingService), Is.EqualTo("off")); }
public void FormatValue_should_throw_if_value_is_null() { var attribute = new FormatBooleanAttribute("on", "off"); Assert.Throws <ArgumentNullException>(() => attribute.FormatValue(null, _formattingService)); }
public void FormatValue_should_throw_if_value_is_not_boolean() { var attribute = new FormatBooleanAttribute("on", "off"); Assert.Throws <InvalidCastException>(() => attribute.FormatValue(32, _formattingService)); }