public void Can_not_parse_wrong_formatted_date(string dateString) { var company = new XingCompany { BeginDateString = dateString }; Assert.Null(company.StartDate); }
public void Can_parse_year_only_begin_date(string dateString, int expectedParsedYear) { var company = new XingCompany { BeginDateString = dateString }; Assert.Null(company.StartDate.Day); Assert.Null(company.StartDate.Month); Assert.NotNull(company.StartDate.Year); Assert.AreEqual(company.StartDate.Year, expectedParsedYear); }
public void Can_parse_year_and_month_end_date(string dateString, int expectedParsedYear, int expectedParsedMonth) { var company = new XingCompany { EndDateString = dateString }; Assert.Null(company.EndDate.Day); Assert.NotNull(company.EndDate.Month); Assert.NotNull(company.EndDate.Year); Assert.AreEqual(company.EndDate.Year, expectedParsedYear); Assert.AreEqual(company.EndDate.Month, expectedParsedMonth); }