Example #1
0
        public void BestSliceHasLenghtOf3SecondCase()
        {
            //Given
            var baseCaseArray          = new int[] { 10, 10, -1, 2, 4, -1, 2, -1 };
            var expectedResult         = 5;
            var minimumAverageTwoSlice = new MinimumAverageTwoSlice();

            //When
            var actualResult = minimumAverageTwoSlice.Solution(baseCaseArray);

            //Then
            Assert.AreEqual(expectedResult, actualResult);
        }
Example #2
0
        public void TestBasicCase()
        {
            //Given
            var baseCaseArray          = new int[] { 4, 2, 2, 5, 1, 5, 8 };
            var expectedResult         = 1;
            var minimumAverageTwoSlice = new MinimumAverageTwoSlice();

            //When
            var actualResult = minimumAverageTwoSlice.Solution(baseCaseArray);

            //Then
            Assert.AreEqual(expectedResult, actualResult);
        }
Example #3
0
        public void BestSliceHasLenghtOf3Case()
        {
            //Given
            var baseCaseArray          = new int[] { -3, -5, -8, -4, -10 };
            var expectedResult         = 2;
            var minimumAverageTwoSlice = new MinimumAverageTwoSlice();

            //When
            var actualResult = minimumAverageTwoSlice.Solution(baseCaseArray);

            //Then
            Assert.AreEqual(expectedResult, actualResult);
        }