public void TestUncertaintyMultiplyConstant() { var u1 = new Uncertainty(7, 0.2, 0.7); var u2 = u1.Multiply(3); Assert.AreEqual(u2, u1 * 3); Assert.AreEqual(u2, 3 * u1); Assert.AreEqual(21, u2.Value); Assert.AreEqual(0.6, u2.LowerUncertainty, 0.00001); Assert.AreEqual(2.1, u2.UpperUncertainty, 0.00001); Assert.IsFalse(u2.IsRelative); }
public void TestUncertaintyMultiply() { var u1 = new Uncertainty(5, 0.5, 1.0); var u2 = new Uncertainty(2.2, 0.1, 0.1); var u3 = u1.Multiply(u2); Assert.AreEqual(u3, u1 * u2); Assert.AreEqual(11, u3.Value); Assert.AreEqual(1.6, u3.LowerUncertainty, 0.00001); Assert.AreEqual(2.7, u3.UpperUncertainty, 0.00001); Assert.IsTrue(u3.IsRelative); }