コード例 #1
0
        public void It_should_format_boolean()
        {
            var attribute = new FormatBooleanAttribute("on", "off");

            Assert.That(attribute.Format(CultureInfo.InvariantCulture, true), Is.EqualTo("on"));
            Assert.That(attribute.Format(CultureInfo.InvariantCulture, false), Is.EqualTo("off"));
        }
コード例 #2
0
        public void It_should_throw_if_value_is_not_boolean()
        {
            var attribute = new FormatBooleanAttribute("on", "off");

            Assert.Throws <InvalidCastException>(() => attribute.Format(CultureInfo.InvariantCulture, 32));
        }