Example #1
0
        public void checkLimitDimensionOfGrid_normal()
        {
            int[] normalGrid = new int[]
            {
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
            };

            var islandExplorer = new IslandExplorer();

            Assert.IsFalse(islandExplorer.checkLimitDimension(normalGrid));
        }
Example #2
0
        public void checkLimitDimensionOfGrid_exceed()
        {
            int[] exceedGrid = new int[]
            {
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
            };

            var islandExplorer = new IslandExplorer();

            Assert.IsTrue(islandExplorer.checkLimitDimension(exceedGrid));
        }