public void GivenValidArguments_WhenDateDiff_ThenDifferenceReturned() { DateTime startDate = DateTime.Now; DateTime endDate = DateTime.Now.AddDays(1); int expected = (int)endDate.Subtract(startDate).TotalMinutes; int?actual = RepositoryFunctions.DateDiff("mi", startDate, endDate); Assert.AreEqual(expected, actual); }
public void GivenNonMinuteDatePart_WhenDateDiff_ThenExceptionThrown() { TestExtensions.ExpectException <NotSupportedException>(() => RepositoryFunctions.DateDiff("", null, null)); }