Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
 public void GivenNonMinuteDatePart_WhenDateDiff_ThenExceptionThrown()
 {
     TestExtensions.ExpectException <NotSupportedException>(() => RepositoryFunctions.DateDiff("", null, null));
 }