예제 #1
0
        public void CanConvertWhenFalseTest()
        {
            var converter = new StringEnumOrDefaultConverter <decimal>();

            var result = converter.CanConvert(typeof(DayOfWeek));

            Assert.IsFalse(result);
        }
예제 #2
0
        public void WriteJsonTest()
        {
            var writer     = new JsonTextWriter(TextWriter.Null);
            var serializer = new JsonSerializer();
            var converter  = new StringEnumOrDefaultConverter <DayOfWeek>();

            Assert.DoesNotThrow(() => converter.WriteJson(writer, DayOfWeek.Sunday, serializer));
        }
예제 #3
0
        public void CanConvertWhenTrueTest()
        {
            var converter = new StringEnumOrDefaultConverter <DayOfWeek>();

            var result = converter.CanConvert(typeof(DayOfWeek));

            Assert.IsTrue(result);
        }