예제 #1
0
        public void ShouldNotEqualDifferentGrid()
        {
            var a = new Custom(Color.Red);
            var b = new Custom(Color.Pink);

            Assert.False(a == b);
            Assert.True(a != b);
            Assert.False(a.Equals(b));
            Assert.AreNotEqual(a, b);
        }
예제 #2
0
        public void ShouldNotEqualDifferentArray()
        {
            var grid = new Custom(Color.Pink);
            var arr = new Color[Constants.MaxRows][];

            // Populate the 2D array
            for (var row = 0; row < Constants.MaxRows; row++)
            {
                arr[row] = new Color[Constants.MaxColumns];
                for (var col = 0; col < Constants.MaxColumns; col++)
                    arr[row][col] = Color.Red;
            }

            Assert.False(grid == arr);
            Assert.True(grid != arr);
            Assert.False(grid.Equals(arr));
            Assert.AreNotEqual(grid, arr);
        }
예제 #3
0
        public void ShouldEqualIdenticalGrid()
        {
            var a = new Custom(Color.Red);
            var b = new Custom(Color.Red);

            Assert.True(a == b);
            Assert.False(a != b);
            Assert.True(a.Equals(b));
            Assert.AreEqual(a, b);
        }