public void UnitMassAddTest() { var l1 = MetricUnit.Kilo <Gram>(2); var l2 = MetricUnit.None <Gram>(500); var l = l1 + l2; Assert.AreEqual <double>(2.5, l.Value); var lr = l2 + l1; Assert.AreEqual <double>(2500, lr.Value); }
public void AddDifferentUnitsAndSameDimension() { Mass <double> on = 1; on.Unit = new Ounce(); var l = MetricUnit.None <Gram>(0); var g = on + l; Assert.AreEqual(g.Value, 1); }