Beispiel #1
0
 public void CalculateAge_UseActualMethod_ShouldBeGreaterThan()
 {
     using (ThreadCulture.EnZa())
     {
         var age = new DateTime(2000, 04, 09).CalculateAge();
         age.ShouldBeGreaterThan(10);
     }
 }
Beispiel #2
0
 public void CalculateAge_OnBirthDay_ShouldMatch()
 {
     using (ThreadCulture.EnZa())
     {
         //var age = DateExtensions.CalculateAge(new DateTime(2014, 04, 09), new DateTime(2000, 04, 09));
         //age.ShouldBe(14);
     }
 }
Beispiel #3
0
 public void FromEpochDate_SupplyValidDate_IsCorrect()
 {
     using (ThreadCulture.EnZa())
     {
         var date = 1389865750L.FromEpochDate();
         date.ToString("dd/MM/yyyy HH:mm:ss tt").ShouldBe("16/01/2014 09:49:10 AM");
     }
 }
Beispiel #4
0
 public void ToCurrencyWithZeroValue_CorrectResult()
 {
     using (ThreadCulture.EnZa())
     {
         var value  = -0m;
         var result = value.ToCurrency();
         result.ShouldBe("R 0.00");
     }
 }
Beispiel #5
0
 public void ToCurrencyWithNegativeValue_CorrectResult()
 {
     using (ThreadCulture.EnZa())
     {
         var value  = -3456212.334m;
         var result = value.ToCurrency();
         result.ShouldBe("-R 3 456 212.33");
     }
 }
Beispiel #6
0
 public void FromEpochDate_SupplyFutureDate_IsCorrect()
 {
     using (ThreadCulture.EnZa())
     {
         var testDate = new DateTime(3022, 12, 13, 22, 59, 58);
         var epoch    = testDate.ToEpochDate();
         var date     = epoch.FromEpochDate();
         date.ToString("dd/MM/yyyy HH:mm:ss tt").ShouldBe("13/12/3022 22:59:58 PM");
     }
 }