예제 #1
0
 public void MethodPlus_Zero_IsNeutralElement()
 {
     Assert.AreEqual(0, Offset.Zero.Plus(Offset.Zero).Milliseconds, "0 + 0");
     Assert.AreEqual(TestObjects.CreatePositiveOffset(3, 0, 0), ThreeHours.Plus(Offset.Zero), "ThreeHours + 0");
     Assert.AreEqual(TestObjects.CreatePositiveOffset(3, 0, 0), Offset.Zero.Plus(ThreeHours), "0 + ThreeHours");
 }
예제 #2
0
 public void MethodPlus_NonZero()
 {
     Assert.AreEqual(TestObjects.CreatePositiveOffset(6, 0, 0), ThreeHours.Plus(ThreeHours), "ThreeHours + ThreeHours");
     Assert.AreEqual(Offset.Zero, ThreeHours.Plus(NegativeThreeHours), "ThreeHours + (-ThreeHours)");
     Assert.AreEqual(TestObjects.CreateNegativeOffset(9, 0, 0), NegativeTwelveHours.Plus(ThreeHours), "-TwelveHours + ThreeHours");
 }
예제 #3
0
 public void OperatorPlus_Zero_IsNeutralElement()
 {
     Assert.AreEqual(0, (Offset.Zero + Offset.Zero).Seconds, "0 + 0");
     Assert.AreEqual(TestObjects.CreatePositiveOffset(3, 0, 0), ThreeHours + Offset.Zero, "ThreeHours + 0");
     Assert.AreEqual(TestObjects.CreatePositiveOffset(3, 0, 0), Offset.Zero + ThreeHours, "0 + ThreeHours");
 }
예제 #4
0
 public void Minus_Zero_IsNeutralElement()
 {
     Assert.AreEqual(Offset.Zero, Offset.Zero.Minus(Offset.Zero), "0 - 0");
     Assert.AreEqual(TestObjects.CreatePositiveOffset(3, 0, 0), ThreeHours.Minus(Offset.Zero), "ThreeHours - 0");
     Assert.AreEqual(TestObjects.CreateNegativeOffset(3, 0, 0), Offset.Zero.Minus(ThreeHours), "0 - ThreeHours");
 }
예제 #5
0
 public void Subtract_NonZero()
 {
     Assert.AreEqual(Offset.Zero, Offset.Subtract(ThreeHours, ThreeHours), "ThreeHours - ThreeHours");
     Assert.AreEqual(TestObjects.CreatePositiveOffset(6, 0, 0), Offset.Subtract(ThreeHours, NegativeThreeHours), "ThreeHours - (-ThreeHours)");
     Assert.AreEqual(TestObjects.CreateNegativeOffset(15, 0, 0), Offset.Subtract(NegativeTwelveHours, ThreeHours), "-TwelveHours - ThreeHours");
 }
예제 #6
0
 public void OperatorMinus_NonZero()
 {
     Assert.AreEqual(Offset.Zero, ThreeHours - ThreeHours, "ThreeHours - ThreeHours");
     Assert.AreEqual(TestObjects.CreatePositiveOffset(6, 0, 0), ThreeHours - NegativeThreeHours, "ThreeHours - (-ThreeHours)");
     Assert.AreEqual(TestObjects.CreateNegativeOffset(15, 0, 0), NegativeTwelveHours - ThreeHours, "-TwelveHours - ThreeHours");
 }
예제 #7
0
 public void OperatorMinus_Zero_IsNeutralElement()
 {
     Assert.AreEqual(Offset.Zero, Offset.Zero - Offset.Zero, "0 - 0");
     Assert.AreEqual(TestObjects.CreatePositiveOffset(3, 0, 0), ThreeHours - Offset.Zero, "ThreeHours - 0");
     Assert.AreEqual(TestObjects.CreateNegativeOffset(3, 0, 0), Offset.Zero - ThreeHours, "0 - ThreeHours");
 }