예제 #1
0
        public void test_solution_givenArray_returnsMaxProductOfTriplets(int[] given, int expected)
        {
            var target = new MaxProductOfThree();
            var actual = target.solution(given);

            Assert.AreEqual(expected, actual);
        }
예제 #2
0
        public void MaxProductOfThree_Should_Process_Negative_Array()
        {
            MaxProductOfThree subject = new MaxProductOfThree();

            int[] array = { -5, 5, -5, 4 };

            int result = subject.solution(array);

            Assert.Equal(125, result);
        }
예제 #3
0
        public void MaxProductOfThree_Should_Process_Simple_Array()
        {
            MaxProductOfThree subject = new MaxProductOfThree();

            int[] array = { -3, 1, 2, -2, 5, 6 };

            int result = subject.solution(array);

            Assert.Equal(60, result);
        }
예제 #4
0
        public void MaxProductOfThree_Should_Handle_Empty_Array()
        {
            MaxProductOfThree subject = new MaxProductOfThree();

            int[] array = { };

            int result = subject.solution(array);

            Assert.Equal(0, result);
        }
예제 #5
0
        public void Case01()
        {
            // Arrange
            var algorithm = new MaxProductOfThree();
            var A         = new int[] { -3, 1, 2, -2, 5, 6 };

            // Act
            var result   = algorithm.solution(A);
            var expected = 60;

            // Assert
            Assert.Equal(expected, result);
        }
예제 #6
0
        private void Test(int[] A, int expectedResult)
        {
            var result = _maxProductOfThree.solution(A);

            Assert.AreEqual(expectedResult, result);
        }
예제 #7
0
        public void MaxProductOfThreeTest_01()
        {
            var solution = mt.solution(new int[] { -3, 1, 2, -2, 5, 6 });

            Assert.AreEqual(60, solution);
        }