Пример #1
0
        public void TestMatZeroDistances()
        {
            MatZeroDistances solution = new MatZeroDistances();

            int[]   first       = { 0, 0, 0 };
            int[]   second      = { 0, 1, 0 };
            int[]   third       = { 1, 1, 1 };
            int[][] mat         = new int[][] { first, second, third };
            int[]   resultThird = { 1, 2, 1 };

            Assert.AreEqual(solution.UpdateMatrix(mat), new int[][] { first, second, resultThird });
        }
Пример #2
0
        public void TestMatDistance()
        {
            int[]            first            = { 0, 0, 0 };
            int[]            second           = { 0, 1, 0 };
            int[]            third            = { 1, 1, 1 };
            int[]            resultThird      = { 1, 2, 1 };
            int[][]          input            = { first, second, third };
            int[][]          expected         = { first, second, resultThird };
            MatZeroDistances matZeroDistances = new MatZeroDistances();

            Assert.AreEqual(matZeroDistances.UpdateMatrix(input), expected);
        }