Example #1
0
        public void EqualsTest()
        {
            var rectangleOne = new IntRectangle(IntVector2.Zero, IntVector2.One);

            Assert.That(rectangleOne.Equals(new IntRectangle(0, 0, 1, 1)));
            Assert.That(rectangleOne.Equals((object)new IntRectangle(0, 0, 1, 1)));
            Assert.That(new IntRectangle(0, 0, 1, 1) == rectangleOne);
            Assert.That(IntRectangle.Empty != rectangleOne);
            Assert.That(rectangleOne.GetHashCode(), Is.EqualTo(rectangleOne.GetHashCode()));
        }
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (_queryArea != null ? _queryArea.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (_resolution != null ? _resolution.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (int)_type;
         hashCode = (hashCode * 397) ^ (int)_mergeStatus;
         return(hashCode);
     }
 }