public void ParseDateShouldReturnNullWhenInputIsIncorrect() { var employeesService = new CouplesEmployees(); string dateAsString = "text"; string allowedFormats = "yyyy-MM-dd"; DateTime?parsedDate = employeesService.ParseDate(dateAsString, allowedFormats); DateTime?result = null; Assert.Equal(result, parsedDate); }
public void ParseDateShouldReturnDateTimeWhenIsCorrectData() { var employeesService = new CouplesEmployees(); string dateAsString = "2013-11-01"; string allowedFormats = "yyyy-MM-dd"; DateTime?parsedDate = employeesService.ParseDate(dateAsString, allowedFormats); DateTime?result = new DateTime(2013, 11, 1); Assert.Equal(result, parsedDate); }