コード例 #1
0
ファイル: IntRectangleTests.cs プロジェクト: klenin/Citrus
        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()));
        }
コード例 #2
0
 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);
     }
 }