public void DefaultPropertiesShouldBeSet() { IMeasurementService measurementService = new MeasurementServiceTest(); var quantity1 = new Quantity(measurementService); Assert.IsTrue(quantity1.IsIntegral()); Assert.IsTrue(quantity1.IsStrictlyComparableTo(new Quantity(measurementService))); }
public void DefaultPropertiesShouldBeSet() { IMeasurementService measurementService = new MeasurementServiceTest(); var quantity1 = new Quantity(measurementService); Assert.IsTrue(quantity1.IsIntegral()); Assert.IsTrue(quantity1.IsStrictlyComparableTo(new Quantity(measurementService))); }
public void CompareShouldbeCorrect() { IMeasurementService measurementService = new MeasurementServiceTest(); var quantity1 = new Quantity(measurementService) { Magnitude = 0.1 }; var quantity2 = new Quantity(measurementService) { Magnitude = 0.2 }; var quantity3 = new Quantity(measurementService) { Magnitude = 0.2 }; Assert.AreEqual(0, quantity2.CompareTo(quantity3)); Assert.AreEqual(-1, quantity1.CompareTo(quantity2)); Assert.AreEqual(1, quantity2.CompareTo(quantity1)); }
public void CompareShouldbeCorrect() { IMeasurementService measurementService = new MeasurementServiceTest(); var quantity1 = new Quantity(measurementService) { Magnitude = 0.1 }; var quantity2 = new Quantity(measurementService) { Magnitude = 0.2 }; var quantity3 = new Quantity(measurementService) { Magnitude = 0.2 }; Assert.AreEqual(0, quantity2.CompareTo(quantity3)); Assert.AreEqual(-1, quantity1.CompareTo(quantity2)); Assert.AreEqual(1, quantity2.CompareTo(quantity1)); }