示例#1
0
        public void PaintFill1RecursiveCompleteTest3IrregularImage()
        {
            var actual = new[, ] {
                { 3, 0, 3, 3 }, { 0, 0, 0, 3 }, { 3, 3, 3, 3 }
            };
            var expected = new[, ] {
                { 3, -1, 3, 3 }, { -1, -1, -1, 3 }, { 3, 3, 3, 3 }
            };

            Assert.IsTrue(PaintFill1RecursiveComplete.PaintFill(actual, 1, 1, -1));
            Assert.IsTrue(MatrixHelpers.Compare(actual, expected));
        }
示例#2
0
        public void PaintFill1RecursiveCompleteTest2NoUpdate()
        {
            var actual = new[, ] {
                { 3, 0, 3, 3 }, { 0, 0, 0, 3 }, { 3, 3, 3, 3 }
            };
            var expected = new[, ] {
                { 3, 0, 3, 3 }, { 0, 0, 0, 3 }, { 3, 3, 3, 3 }
            };

            Assert.IsFalse(PaintFill1RecursiveComplete.PaintFill(actual, 1, 1, 0));
            Assert.IsTrue(MatrixHelpers.Compare(actual, expected));
        }