public void Index_Should_Return_Null() { //Arrange _calculateDatesService.Stub(o => o.GetDatesToDisplay()).Return(null); // Act var difference = _controller.Index() as ViewResult; // Assert Assert.IsNull(difference.Model); }
public void CalculateDaysDifference_Should_Return_NotNull() { var selectedDates = new DatesToDisplayEntity() { DateFrom = new DateTime(2016, 05, 08), DateTo = new DateTime(2016, 05, 11) }; //Arrange _calculateDatesServiceMocked.Stub(o => o.CalculateDaysDifference(selectedDates.DateFrom, selectedDates.DateTo)); // Act var result = _calculateDatesService.CalculateDaysDifference(selectedDates.DateFrom, selectedDates.DateTo); // Assert Assert.IsNotNull(result); Assert.AreEqual("3", result); }