示例#1
0
        public void SetZeroes_2Test_HasZero_TopLeft()
        {
            var input = new int[, ]
            {
                { 0, 2, 3 },
                { 4, 5, 6 },
                { 7, 8, 9 }
            };

            var solution = new _073_SetMatrixZeroes();

            solution.SetZeroes_2(input);

            AssertHelper.AssertMatrix(new int[, ]
            {
                { 0, 0, 0 },
                { 0, 5, 6 },
                { 0, 8, 9 }
            }, input);
        }
示例#2
0
        public void SetZeroes_2Test_NoZero()
        {
            var input = new int[, ]
            {
                { 1, 2, 3 },
                { 4, 5, 6 },
                { 7, 8, 9 }
            };

            var solution = new _073_SetMatrixZeroes();

            solution.SetZeroes_2(input);

            AssertHelper.AssertMatrix(new int[, ]
            {
                { 1, 2, 3 },
                { 4, 5, 6 },
                { 7, 8, 9 }
            }, input);
        }
示例#3
0
        public void SetZeroes_2Test_HasZero_Multiple()
        {
            var input = new int[, ]
            {
                { 1, 2, 3, 4 },
                { 4, 0, 6, 7 },
                { 7, 8, 0, 10 },
                { 10, 11, 12, 13 }
            };

            var solution = new _073_SetMatrixZeroes();

            solution.SetZeroes_2(input);

            AssertHelper.AssertMatrix(new int[, ]
            {
                { 1, 0, 0, 4 },
                { 0, 0, 0, 0 },
                { 0, 0, 0, 0 },
                { 10, 0, 0, 13 }
            }, input);
        }
        public void SetZeroes_2Test_NoZero()
        {
            var input = new int[,]
            {
                { 1, 2, 3 },
                { 4, 5, 6 },
                { 7, 8, 9 }
            };

            var solution = new _073_SetMatrixZeroes();
            solution.SetZeroes_2(input);

            AssertHelper.AssertMatrix(new int[,]
            {
                { 1, 2, 3 },
                { 4, 5, 6 },
                { 7, 8, 9 }
            }, input);
        }
        public void SetZeroes_2Test_HasZero_TopLeft()
        {
            var input = new int[,]
            {
                { 0, 2, 3 },
                { 4, 5, 6 },
                { 7, 8, 9 }
            };

            var solution = new _073_SetMatrixZeroes();
            solution.SetZeroes_2(input);

            AssertHelper.AssertMatrix(new int[,]
            {
                { 0, 0, 0 },
                { 0, 5, 6 },
                { 0, 8, 9 }
            }, input);
        }
        public void SetZeroes_2Test_HasZero_Multiple()
        {
            var input = new int[,]
            {
                { 1, 2, 3, 4 },
                { 4, 0, 6, 7 },
                { 7, 8, 0, 10 },
                { 10, 11, 12, 13 }
            };

            var solution = new _073_SetMatrixZeroes();
            solution.SetZeroes_2(input);

            AssertHelper.AssertMatrix(new int[,]
            {
                { 1, 0, 0, 4 },
                { 0, 0, 0, 0 },
                { 0, 0, 0, 0 },
                { 10, 0, 0, 13 }
            }, input);
        }