コード例 #1
0
        public void BoundingCylinder_Equals_Test()
        {
            BoundingCylinder cyl1 = new BoundingCylinder (sideA: Vector3.Zero, sideB: Vector3.Up * 100, radius: 100f);
            BoundingCylinder cyl2 = new BoundingCylinder (sideA: Vector3.Up * 100, sideB: Vector3.Zero, radius: 100f);
            IsEqual (cyl1, cyl1);
            IsEqual (cyl1, cyl2);
            IsEqual (cyl2, cyl1);

            BoundingCylinder cyl3 = new BoundingCylinder (sideA: Vector3.Up * 100, sideB: Vector3.Zero, radius: 200f);
            IsNotEqual (cyl1, cyl3);
            IsNotEqual (cyl2, cyl3);
            IsNotEqual (cyl3, cyl1);
            IsNotEqual (cyl3, cyl2);

            BoundingCylinder cyl4 = new BoundingCylinder (sideA: Vector3.Up * 50, sideB: Vector3.Down * 50, radius: 100f);
            IsNotEqual (cyl1, cyl4);
            IsNotEqual (cyl2, cyl4);
            IsNotEqual (cyl4, cyl1);
            IsNotEqual (cyl4, cyl2);

            Assert.IsTrue (cyl1.Equals ((object)cyl1));
            Assert.IsFalse (cyl1.Equals ((object)cyl4));
            Assert.IsFalse (cyl1.Equals ((object)null));
        }
コード例 #2
0
 private void IsNotEqual(BoundingCylinder a, BoundingCylinder b)
 {
     Assert.IsTrue (!a.Equals (b));
     Assert.IsTrue (a != b);
 }
コード例 #3
0
 private void IsEqual(BoundingCylinder a, BoundingCylinder b)
 {
     Assert.IsTrue (a.Equals (b));
     Assert.IsTrue (a == b);
 }