public void DateTimeAmericanConverterOk() { DateTimeConverterAttribute dateTimeConverter = new DateTimeConverterAttribute("MM/dd/yyyy"); TestDecorator valueProvider = new TestDecorator("10/14/2019"); dateTimeConverter.SetDecorator(valueProvider); DateTime actual = (DateTime)dateTimeConverter.GetValue(); Assert.AreEqual(new DateTime(2019, 10, 14), actual); }
public void DateTimeConverterOk() { DateTimeConverterAttribute dateTimeConverter = new DateTimeConverterAttribute("yyyy-MM-dd"); TestDecorator valueProvider = new TestDecorator("2019-10-14"); dateTimeConverter.SetDecorator(valueProvider); DateTime actual = (DateTime)dateTimeConverter.GetValue(); Assert.AreEqual(new DateTime(2019, 10, 14), actual); }