public void DateRangeIsValid_StartDateCannotBeInThePast_ThrowsArgumentException(DateTime startDate, DateTime endDate) { //Object to test DateChecker dc = new DateChecker(); //Test parameters //DateTime startDate = DateTime.Now.AddDays(-14); //DateTime endDate = DateTime.Today.AddDays(7); //Test Assert.Throws <ArgumentException>(() => dc.DateRangeIsValid(startDate, endDate)); }
public void DateRangeIsValid_EndDateIsNotOnStartDate_ThrowsArgumentException(DateTime startDate, DateTime endDate) { //Object to test DateChecker dc = new DateChecker(); //Test parameters //DateTime startDate = DateTime.Today.AddDays(14); //DateTime endDate = DateTime.Today.AddDays(14); //Test Assert.Throws <ArgumentException>(() => dc.DateRangeIsValid(startDate, endDate)); }
public void DateRangeIsValid_StartdateCanBeToday_ThrowsArgumentException(DateTime startDate, DateTime endDate) { //Object to test DateChecker dc = new DateChecker(); //Test parameters //DateTime startDate = DateTime.Today; //DateTime endDate = DateTime.Today.AddDays(7); //Test var actualResult = dc.DateRangeIsValid(startDate, endDate); var expectedResult = true; Assert.Equal(expectedResult, actualResult); }