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

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

            Assert.True(a == b);
            Assert.False(a != b);
            Assert.True(a.Equals(b));
            Assert.AreEqual(a, b);
        }
예제 #3
0
        public void ShouldNotEqualDifferent2DArray()
        {
            var grid = new CustomKeyboardEffect(Color.Pink);
            var arr  = new Color[KeyboardConstants.MaxRows][];

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

            Assert.False(grid == arr);
            Assert.True(grid != arr);
            Assert.False(grid.Equals(arr));
            Assert.AreNotEqual(grid, arr);
        }