Exemplo n.º 1
0
 public void AddToNoMonthTest()
 {
     try
     {
         var fd      = new FuzzyDate(2019);
         var newDate = fd.AddMonths(10);
         Assert.IsFalse(newDate.Month.HasValue);
         Assert.IsFalse(newDate.Day.HasValue);
     }
     catch (Exception ex)
     {
         Assert.Fail($"Expect no exception, but got {ex.Message}");
     }
 }
Exemplo n.º 2
0
 public void AddPositiveMonthsTest()
 {
     try
     {
         var fd      = new FuzzyDate(2019, 9);
         var newDate = fd.AddMonths(10);
         Assert.AreEqual(2020, newDate.Year);
         Assert.AreEqual(7, newDate.Month);
         Assert.IsFalse(newDate.Day.HasValue);
     }
     catch (Exception ex)
     {
         Assert.Fail($"Expect no exception, but got {ex.Message}");
     }
 }