public void TestUncertaintyProperties() { var u = new Uncertainty(7.6, 1.1, 0.4); Assert.AreEqual(1.5, u.TotalUncertainty); Assert.AreEqual(6.5, u.Minimum); Assert.AreEqual(8.0, u.Maximum); Assert.AreEqual(0.1447368, u.LowerPercentage, 0.00001); Assert.AreEqual(0.0526316, u.UpperPercentage, 0.00001); Assert.IsFalse(u.IsSymmetric()); }
public void TestUncertaintySymmetric() { var u1 = new Uncertainty(6, 0.5); var u2 = Uncertainty.FromPercentage(7, 0.10, 0.10); Assert.IsTrue(u1.IsSymmetric()); Assert.AreEqual(u1.LowerUncertainty, u1.UpperUncertainty); Assert.AreEqual(u1.LowerPercentage, u1.UpperPercentage); Assert.IsTrue(u2.IsSymmetric()); Assert.AreEqual(u2.LowerUncertainty, u2.UpperUncertainty); Assert.AreEqual(u2.LowerPercentage, u2.UpperPercentage); }