Пример #1
0
        public void TrapTest_EmptyInput()
        {
            var solution = new _042_TrappingRainWater();
            var result   = solution.Trap(new int[] { });

            Assert.AreEqual(0, result);
        }
Пример #2
0
        public void TrapTest_EmptyInput()
        {
            var solution = new _042_TrappingRainWater();
            var result = solution.Trap(new int[] { });

            Assert.AreEqual(0, result);
        }
Пример #3
0
        public void TrapTest_Lower()
        {
            var input = new int[] { 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 };

            var solution = new _042_TrappingRainWater();
            var result = solution.Trap(input);

            Assert.AreEqual(0, result);
        }
Пример #4
0
        public void TrapTest_LastOneHigher()
        {
            var input = new int[] { 1, 0, 1, 0, 1, 0, 1, 0, 1, 2 };

            var solution = new _042_TrappingRainWater();
            var result = solution.Trap(input);

            Assert.AreEqual(4, result);
        }
Пример #5
0
        public void TrapTest_Higher()
        {
            var input = new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };

            var solution = new _042_TrappingRainWater();
            var result = solution.Trap(input);

            Assert.AreEqual(0, result);
        }
Пример #6
0
        public void TrapTest_Balance()
        {
            var input = new int[] { 2, 0, 2 };

            var solution = new _042_TrappingRainWater();
            var result = solution.Trap(input);

            Assert.AreEqual(2, result);
        }
Пример #7
0
        public void TrapTest()
        {
            var input = new int[] { 0, 1, 0, 2, 1, 0, 1, 3, 2, 1, 2, 1 };

            var solution = new _042_TrappingRainWater();
            var result = solution.Trap(input);

            Assert.AreEqual(6, result);
        }
Пример #8
0
        public void TrapTest()
        {
            var input = new int[] { 0, 1, 0, 2, 1, 0, 1, 3, 2, 1, 2, 1 };

            var solution = new _042_TrappingRainWater();
            var result   = solution.Trap(input);

            Assert.AreEqual(6, result);
        }
Пример #9
0
        public void TrapTest_Lower()
        {
            var input = new int[] { 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 };

            var solution = new _042_TrappingRainWater();
            var result   = solution.Trap(input);

            Assert.AreEqual(0, result);
        }
Пример #10
0
        public void TrapTest_Higher()
        {
            var input = new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };

            var solution = new _042_TrappingRainWater();
            var result   = solution.Trap(input);

            Assert.AreEqual(0, result);
        }
Пример #11
0
        public void TrapTest_LastOneHigher()
        {
            var input = new int[] { 1, 0, 1, 0, 1, 0, 1, 0, 1, 2 };

            var solution = new _042_TrappingRainWater();
            var result   = solution.Trap(input);

            Assert.AreEqual(4, result);
        }
Пример #12
0
        public void TrapTest_Balance()
        {
            var input = new int[] { 2, 0, 2 };

            var solution = new _042_TrappingRainWater();
            var result   = solution.Trap(input);

            Assert.AreEqual(2, result);
        }