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

            Assert.AreEqual(5, result);
        }
Example #2
0
        public void TestThirdCase_3()
        {
            int[] arr    = new int[] { 7, 6, 4, 3, 1 };
            var   prof   = new MaxProfit1(arr);
            var   result = prof.GetMaxProfit2();

            Assert.AreEqual(0, result);
        }
Example #3
0
        public void TestFirstCase_2()
        {
            int[] arr    = null;
            var   prof   = new MaxProfit1(arr);
            var   result = prof.GetMaxProfit2();

            Assert.AreEqual(0, result);
        }