Exemple #1
0
        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"));
        }
Exemple #2
0
        public void FormatValue_should_throw_if_value_is_null()
        {
            var attribute = new FormatBooleanAttribute("on", "off");

            Assert.Throws <ArgumentNullException>(() => attribute.FormatValue(null, _formattingService));
        }
Exemple #3
0
        public void FormatValue_should_throw_if_value_is_not_boolean()
        {
            var attribute = new FormatBooleanAttribute("on", "off");

            Assert.Throws <InvalidCastException>(() => attribute.FormatValue(32, _formattingService));
        }