Exemplo n.º 1
0
 public void EqualsTest()
 {
     Assert.That(unitSphere.Equals(unitSphere));
     Assert.That(unitSphere.Equals((object)unitSphere));
     Assert.That(unitSphere == unitSphere);
     Assert.That(unitSphere != new BoundingSphere(Vector3.Zero, 0));
     Assert.That(unitSphere.GetHashCode(), Is.EqualTo(unitSphere.GetHashCode()));
 }
        public void Equals_ReturnsFalseForNonEqual()
        {
            var a = new BoundingSphere(new Vector3(1, 2, 3), 4);
            var b = new BoundingSphere(new Vector3(5, 6, 7), 8);

            Assert.IsFalse(a.Equals(b));
            Assert.IsFalse(a.Equals((object)b));
            Assert.IsFalse(a == b);
        }
        public void Equals_ReturnsTrueForEqual()
        {
            var a = new BoundingSphere(new Vector3(1, 2, 3), 4);
            var b = a;

            Assert.IsTrue(a.Equals(b));
            Assert.IsTrue(a.Equals((object)b));
            Assert.IsTrue(a == b);
        }
Exemplo n.º 4
0
        public void TestEquals()
        {
            bool result;

            result = s.Equals(s);
            Assert.AreEqual(true, result, "Equals#1");

            result = s.Equals(new BoundingSphere(new Vector3(53, 3, 21), 253f));
            Assert.AreEqual(false, result, "Equals#2");

            result = s.Equals(null);
            Assert.AreEqual(false, result, "Equals#3");

            result = s.Equals(new int());
            Assert.AreEqual(false, result, "Equals#4");

            result = s.Equals((object)s);
            Assert.AreEqual(true, result, "Equals#5");
        }