示例#1
0
        public void TestFifthCase_2()
        {
            int[] arr    = new int[] { 6, 1, 3, 2, 4, 7 };
            var   prof   = new MaxProfit2(arr);
            var   result = prof.GetMaxProfit2();

            Assert.AreEqual(7, result);
        }
示例#2
0
        public void TestFourtCase_2()
        {
            int[] arr    = new int[] { 7, 6, 4, 3, 1 };
            var   prof   = new MaxProfit2(arr);
            var   result = prof.GetMaxProfit2();

            Assert.AreEqual(0, result);
        }
示例#3
0
        public void TestFirstCase()
        {
            int[] arr    = null;
            var   prof   = new MaxProfit2(arr);
            var   result = prof.GetMaxProfit1();

            Assert.AreEqual(0, result);
        }
示例#4
0
        public void TestThirdCase_2()
        {
            int[] arr    = new int[] { 1, 2, 3, 4, 5 };
            var   prof   = new MaxProfit2(arr);
            var   result = prof.GetMaxProfit2();

            Assert.AreEqual(4, result);
        }
示例#5
0
        public void TestSecondCase_2()
        {
            int[] arr    = new int[] { 7, 1, 5, 3, 6, 4 };
            var   prof   = new MaxProfit2(arr);
            var   result = prof.GetMaxProfit2();

            Assert.AreEqual(7, result);
        }