public void TestDateTimeConversionWithFormat() { var converter = new DateTimeConverter("dd.MM.yyyy"); Assert.AreEqual(new DateTime(2007, 11, 5), converter.ConvertFromString("05.11.2007", CULTURE, typeof(DateTime))); Assert.Throws <FormatException>(() => converter.ConvertFromString("05/11/2007", CULTURE, typeof(DateTime))); Assert.Throws <FormatException>(() => converter.ConvertFromString("05.11.2007 12:01:02", CULTURE, typeof(DateTime?))); }