Exemplo n.º 1
0
        public void Formatters_Ctor_Assigns_Formatters_During_Construction()
        {
            var resolver = new TypeFormatterResolver(new DateTime_Iso8601_Formatter());

            var formatter = resolver.Find <DateTime>();

            Assert.IsInstanceOfType(formatter, typeof(DateTime_Iso8601_Formatter));
        }
Exemplo n.º 2
0
        public void Find_Returns_Assigned_Generic_TypeFormatterResolver()
        {
            var resolver = new TypeFormatterResolver(new DateTime_Iso8601_Formatter());

            var formatter = resolver.Find <DateTime>();

            Assert.IsInstanceOfType(formatter, typeof(DateTime_Iso8601_Formatter));
        }
Exemplo n.º 3
0
        public void Find_Returns_Null_If_Formatter_Assigned_To_Different_Type()
        {
            var resolver = new TypeFormatterResolver(new DateTimeOffset_Iso8601_Formatter());

            var formatter = resolver.Find <DateTime>();

            Assert.IsNull(formatter);
        }
Exemplo n.º 4
0
        public void Find_Returns_Null_If_No_Formatter_Assigned()
        {
            var resolver = new TypeFormatterResolver();

            var formatter = resolver.Find <DateTime>();

            Assert.IsNull(formatter);
        }