コード例 #1
0
        public void TestEqualsObject()
        {
            Vector2           first      = new Vector2(1.2f, 3.4f);
            Vector2           second     = new Vector2(5.6f, 7.8f);
            BoundingRectangle rectangle1 = new BoundingRectangle(first, second);
            BoundingRectangle rectangle2 = new BoundingRectangle(first, second);

            Assert.IsTrue(rectangle1.Equals((object)rectangle2));
            Assert.IsFalse(rectangle2.Equals((object)(new BoundingRectangle())));
        }
コード例 #2
0
    public void TestEquals() {
      Vector2 first = new Vector2(1.2f, 3.4f);
      Vector2 second = new Vector2(5.6f, 7.8f);
      BoundingRectangle rectangle1 = new BoundingRectangle(first, second);
      BoundingRectangle rectangle2 = new BoundingRectangle(first, second);

      Assert.IsTrue(rectangle1.Equals(rectangle2));
      Assert.IsFalse(rectangle2.Equals(new BoundingRectangle()));
    }
コード例 #3
0
 public void TestEqualsWithIncompatibleObject() {
   BoundingRectangle rectangle = new BoundingRectangle();
   Assert.IsFalse(rectangle.Equals("Hello World"));
 }
コード例 #4
0
 public void TestEqualsNull() {
   BoundingRectangle rectangle = new BoundingRectangle();
   Assert.IsFalse(rectangle.Equals(null));
 }
コード例 #5
0
        public void TestEqualsWithIncompatibleObject()
        {
            BoundingRectangle rectangle = new BoundingRectangle();

            Assert.IsFalse(rectangle.Equals("Hello World"));
        }
コード例 #6
0
        public void TestEqualsNull()
        {
            BoundingRectangle rectangle = new BoundingRectangle();

            Assert.IsFalse(rectangle.Equals(null));
        }