public void TestUncertaintyHashCode() { var u1 = new Uncertainty(0.8, 0.1, 0.2); var u2 = new Uncertainty(0.8, 0.2, 0.1); Assert.AreNotEqual(u1.GetHashCode(), u2.GetHashCode()); Assert.AreEqual(u1.GetHashCode(), u1.Clone().GetHashCode()); }
public void TestUncertaintyCompare() { var u1 = new Uncertainty(0.8, 0.2, 0.1); var u2 = new Uncertainty(0.9, 0.2, 0.1); Assert.AreEqual(0, u1.CompareTo(u1.Clone())); Assert.AreEqual(-1, u1.CompareTo(u2)); Assert.AreEqual(1, u2.CompareTo(u1)); }
public void TestUncertaintyEquals() { var u1 = new Uncertainty(0.6, 0.1, 0.2); var u2 = new Uncertainty(0.3, 0.1, 0.2); Assert.IsTrue(u1.Equals(u1)); Assert.IsTrue(u1.Equals(u1.Clone())); Assert.IsFalse(u1.Equals(u2)); }
public void TestUncertaintyEquality() { var u1 = new Uncertainty(3, 0.1); var u2 = new Uncertainty(4, 0.1); var u3 = new Uncertainty(5, 0.3); var u4 = new Uncertainty(3, 0.2); Assert.IsTrue(u2 > u1); Assert.IsTrue(u3 >= u2); Assert.IsFalse(u1 > u4); Assert.IsTrue(u2 < u3); Assert.IsTrue(u4 <= u3); Assert.IsFalse(u4 == u1); Assert.IsFalse(u3 == u2); Assert.IsTrue(u3 == u3.Clone()); }