예제 #1
0
        public void FlipAndInvertImageTests()
        {
            FlippingAnImage obj = new FlippingAnImage();

            int[][] arr = new int[][] {
                new[] { 1, 1, 0 },
                new[] { 1, 0, 1 },
                new[] { 0, 0, 0 }
            };

            var x = obj.FlipAndInvertImage(arr);
        }
예제 #2
0
        public void FilppingAnImageTestMethod()
        {
            FlippingAnImage flippingAnImage = new FlippingAnImage();

            int[][] expected = new int[4][];
            expected[0] = new int[] { 1, 1, 0, 0 };
            expected[1] = new int[] { 0, 1, 1, 0 };
            expected[2] = new int[] { 0, 0, 0, 1 };
            expected[3] = new int[] { 1, 0, 1, 0 };

            int[][] A = new int[4][];
            A[0] = new int[] { 1, 1, 0, 0 };
            A[1] = new int[] { 1, 0, 0, 1 };
            A[2] = new int[] { 0, 1, 1, 1 };
            A[3] = new int[] { 1, 0, 1, 0 };
            int[][] actual = flippingAnImage.FlipAndInvertImage(A);
            for (int i = 0; i < expected.Length; i++)
            {
                for (int j = 0; j < actual[i].Length; j++)
                {
                    Assert.AreEqual(expected[i][j], actual[i][j]);
                }
            }
        }