public void UnitReversedConvertToThroughOtherUnitSystems() { Unit pu = new DerivedUnit(Physics.CGS_Units, new SByte[] { 2, 0, -4, 0, 0, 0, 0 }); Unit expectedunit = new DerivedUnit(Physics.MGM_Units, pu.Exponents); Quantity expected = new Quantity(1D / (Math.Pow(100, 2) * Math.Pow(24 * 60 * 60, -4) / Math.Pow(10000, -4)), expectedunit); IQuantity actual = pu.ConvertTo(expectedunit); Assert.AreEqual(expected, actual); }
public void UnitConvertToSIUnit() { Unit pu = new DerivedUnit(Physics.MGD_Units, new SByte[] { 2, 0, -4, 0, 0, 0, 0 }); Unit expectedunit = new DerivedUnit(Physics.SI_Units, pu.Exponents); Quantity expected = new Quantity(Math.Pow(24 * 60 * 60, -4), expectedunit); IQuantity actual = pu.ConvertTo(expectedunit); Assert.AreEqual(expected, actual); }