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"); }
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"); }
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"); }
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"); }
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"); }
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"); }
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"); }