Esempio n. 1
0
        public void TestMethod2()
        {
            List<int> seq = new List<int> { 2, 4, -6 };
            var solver = new MaximumSubArraySolver();
            int maxSum = solver.GetMaximumSubArraySum(seq);

            Assert.IsTrue(maxSum == 6);
        }
Esempio n. 2
0
        public void TestMethod3()
        {
            List<int> seq = new List<int> { 2, 8, -6, 5, 7, -4, 3, -4, 6 };
            var solver = new MaximumSubArraySolver();
            int maxSum = solver.GetMaximumSubArraySum(seq);

            Assert.IsTrue(maxSum == 17);
        }
Esempio n. 3
0
 public void TestMethod1()
 {
     List<int> seq = new List<int> { 2, 4, -6};
     var solver = new MaximumSubArraySolver();
     List<int> maxSubArray = solver.GetMaximumSubArray(seq);
     Assert.IsTrue(maxSubArray.Contains(2));
     Assert.IsTrue(maxSubArray.Contains(4));
 }