示例#1
0
        //[Fact]
        public void TestCaseX()
        {
            var result = LeadALife.calculateProfit(20, new List <int> {
                5, 1, 9, 7, 9, 2, 7, 7, 9, 6, 7, 6, 6, 3, 4, 2, 8, 4, 6, 10
            }, new List <int> {
                3, 1, 4, 1, 1, 5, 2, 3, 3, 3, 2, 4, 4, 3, 3, 4, 4, 1, 2, 5
            }, 5);

            Assert.Equal(345, result);
        }
示例#2
0
        public void TestCase5()
        {
            var result = LeadALife.calculateProfit(11, new List <int> {
                9, 9, 10, 10, 1, 2, 1, 10, 2, 4, 2
            }, new List <int> {
                2, 4, 1, 1, 5, 1, 5, 1, 3, 5, 5
            }, 15);

            Assert.Equal(660, result);
        }
示例#3
0
        public void TestCaseCustom2()
        {
            var result = LeadALife.calculateProfit(4, new List <int> {
                7, 2, 2, 4
            }, new List <int> {
                7, 3, 2, 6
            }, 5);

            Assert.Equal(45, result);
        }
示例#4
0
        public void TestCase4()
        {
            var result = LeadALife.calculateProfit(11, new List <int> {
                2, 5, 10, 8, 5, 3, 1, 4, 6, 8, 6
            }, new List <int> {
                4, 4, 4, 1, 5, 1, 4, 4, 3, 5, 1
            }, 15);

            Assert.Equal(450, result);
        }
示例#5
0
        public void TestCase2()
        {
            var result = LeadALife.calculateProfit(4, new List <int> {
                1, 8, 6, 7
            }, new List <int> {
                1, 3, 4, 1
            }, 5);

            Assert.Equal(70, result);
        }
示例#6
0
        public void TestCase1()
        {
            var result = LeadALife.calculateProfit(3, new List <int> {
                1, 5, 5
            }, new List <int> {
                2, 1, 4
            }, 4);

            Assert.Equal(36, result);
        }
示例#7
0
        public void TestCase0()
        {
            var result = LeadALife.calculateProfit(2, new List <int> {
                1, 2
            }, new List <int> {
                1, 4
            }, 5);

            Assert.Equal(10, result);
        }
示例#8
0
        //[Fact]
        public void TestCase12()
        {
            var result = LeadALife.calculateProfit(100,
                                                   new List <int> {
                5, 3, 1, 4, 1, 3, 4, 1, 1, 3, 63, 60, 20, 28, 74, 15, 41, 83, 30, 12, 18, 85, 37, 71, 46, 70, 79, 19, 80, 37, 38, 15, 61, 43, 95, 32, 93, 4, 94, 15, 66, 57, 74, 37, 84, 47, 3, 76, 81, 85, 40, 99, 21, 76, 69, 66, 45, 47, 85, 76, 35, 74, 42, 96, 16, 37, 79, 60, 40, 24, 74, 57, 80, 99, 45, 16, 98, 47, 43, 78, 83, 82, 28, 3, 57, 48, 69, 53, 46, 5, 29, 1, 3, 2, 3, 5, 3, 3, 5, 4
            },
                                                   new List <int> {
                1, 5, 2, 3, 4, 1, 5, 1, 5, 2, 5, 2, 1, 3, 2, 4, 5, 2, 2, 1, 1, 2, 3, 5, 3, 2, 4, 3, 4, 5, 1, 1, 5, 3, 5, 3, 5, 1, 5, 4, 5, 4, 3, 5, 1, 4, 3, 3, 5, 1, 5, 2, 4, 2, 1, 4, 5, 4, 1, 5, 4, 1, 2, 5, 5, 2, 2, 5, 4, 3, 3, 3, 1, 2, 4, 4, 5, 4, 1, 4, 4, 5, 2, 5, 3, 2, 3, 4, 3, 3, 3, 3, 5, 4, 2, 2, 2, 5, 1, 3
            },
                                                   15);

            Assert.Equal(345, result);
        }
示例#9
0
        //[Fact]
        public void TestCase11()
        {
            var result = LeadALife.calculateProfit(99,
                                                   new List <int> {
                3, 1, 5, 3, 4, 2, 5, 4, 1, 1, 9, 93, 76, 9, 96, 6, 46, 100, 18, 94, 84, 70, 38, 19, 50, 33, 33, 62, 12, 79, 62, 41, 39, 32, 75, 49, 30, 9, 19, 37, 36, 79, 29, 12, 87, 24, 69, 32, 75, 86, 77, 11, 7, 14, 81, 56, 98, 13, 69, 61, 91, 31, 1, 81, 14, 75, 81, 43, 84, 99, 31, 71, 29, 59, 82, 67, 35, 2, 50, 61, 87, 27, 71, 45, 92, 51, 100, 42, 16, 21, 2, 1, 1, 3, 4, 4, 2, 4, 3
            },
                                                   new List <int> {
                2, 5, 3, 5, 3, 3, 3, 5, 2, 5, 1, 3, 3, 4, 5, 3, 1, 1, 4, 4, 1, 4, 2, 3, 4, 1, 1, 4, 3, 5, 3, 1, 1, 2, 5, 3, 5, 5, 4, 3, 4, 5, 2, 1, 3, 2, 3, 5, 4, 2, 5, 1, 5, 2, 3, 1, 2, 1, 1, 1, 2, 4, 4, 2, 5, 5, 4, 1, 4, 5, 1, 2, 1, 2, 5, 3, 5, 2, 5, 3, 5, 4, 5, 2, 5, 5, 4, 2, 5, 4, 4, 1, 2, 2, 2, 4, 2, 2, 1
            },
                                                   15);

            Assert.Equal(660, result);
        }
示例#10
0
        //[Fact]
        public void TestCase10()
        {
            var result = LeadALife.calculateProfit(96,
                                                   new List <int> {
                2, 5, 4, 1, 4, 3, 5, 2, 1, 2, 1, 4, 4, 4, 4, 1, 5, 1, 2, 2, 4, 4, 3, 3, 3, 3, 5, 3, 2, 2, 5, 3, 2, 5, 5, 2, 2, 1, 5, 4, 2, 5, 2, 2, 5, 2, 3, 1, 2, 1, 2, 2, 4, 2, 4, 2, 4, 5, 1, 5, 4, 2, 5, 2, 1, 1, 3, 5, 2, 4, 3, 5, 1, 2, 2, 2, 5, 1, 3, 4, 1, 1, 5, 2, 4, 1, 5, 3, 2, 5, 4, 5, 1, 3, 1, 3
            },
                                                   new List <int> {
                1, 5, 2, 4, 4, 5, 3, 1, 3, 1, 2, 2, 1, 1, 2, 4, 4, 4, 5, 2, 4, 4, 1, 2, 5, 5, 2, 2, 4, 4, 4, 4, 4, 3, 4, 4, 2, 4, 1, 1, 4, 2, 4, 2, 5, 1, 5, 5, 4, 1, 1, 4, 1, 2, 5, 5, 3, 3, 3, 1, 2, 3, 2, 5, 5, 5, 5, 3, 3, 5, 3, 4, 3, 2, 2, 4, 4, 3, 3, 4, 3, 4, 2, 3, 2, 3, 4, 4, 1, 3, 1, 4, 5, 2, 5, 5
            },
                                                   15);

            Assert.Equal(660, result);
        }
示例#11
0
        //[Fact]
        public void TestCase9()
        {
            var result = LeadALife.calculateProfit(98,
                                                   new List <int> {
                4, 2, 5, 3, 1, 5, 3, 1, 2, 5, 82, 18, 49, 99, 40, 39, 70, 25, 58, 7, 38, 36, 54, 50, 13, 27, 93, 100, 17, 72, 8, 60, 3, 99, 93, 4, 88, 80, 19, 60, 26, 100, 77, 26, 51, 68, 64, 72, 92, 73, 78, 81, 61, 84, 30, 73, 62, 74, 72, 79, 45, 31, 90, 48, 81, 82, 3, 69, 14, 73, 80, 91, 72, 8, 17, 74, 75, 80, 98, 18, 5, 27, 98, 65, 62, 79, 37, 24, 52, 60, 54, 1, 3, 3, 5, 5, 2, 2
            },
                                                   new List <int> {
                3, 2, 4, 4, 2, 3, 3, 3, 3, 2, 5, 5, 1, 4, 4, 3, 3, 5, 1, 1, 5, 2, 5, 3, 5, 4, 3, 4, 4, 1, 3, 3, 2, 3, 4, 3, 2, 1, 3, 5, 5, 2, 1, 5, 5, 4, 3, 2, 1, 5, 2, 5, 2, 3, 5, 3, 4, 2, 1, 2, 4, 3, 1, 5, 1, 4, 4, 2, 5, 1, 3, 4, 2, 1, 3, 1, 1, 2, 4, 1, 4, 5, 1, 5, 5, 5, 4, 3, 3, 4, 1, 1, 4, 1, 5, 1, 2, 3
            },
                                                   15);

            Assert.Equal(660, result);
        }
示例#12
0
        //[Fact]
        public void TestCase8()
        {
            var result = LeadALife.calculateProfit(48,
                                                   new List <int> {
                5, 5, 5, 2, 3, 1, 2, 4, 3, 2, 50, 46, 32, 44, 24, 40, 15, 26, 8, 14, 6, 10, 8, 13, 26, 6, 22, 24, 40, 16, 31, 50, 12, 43, 13, 19, 33, 46, 7, 7, 33, 3, 2, 1, 4, 2, 2, 3
            },
                                                   new List <int> {
                4, 1, 1, 4, 5, 1, 3, 1, 3, 2, 4, 3, 2, 2, 4, 3, 4, 1, 3, 3, 4, 4, 1, 3, 4, 4, 3, 2, 1, 1, 1, 1, 4, 1, 2, 3, 3, 4, 5, 1, 5, 4, 5, 3, 2, 3, 5, 2
            },
                                                   15);

            Assert.Equal(660, result);
        }
示例#13
0
        //[Fact]
        public void TestCase7()
        {
            var result = LeadALife.calculateProfit(47,
                                                   new List <int> {
                2, 4, 1, 3, 1, 2, 4, 1, 2, 4, 43, 5, 43, 17, 47, 36, 32, 13, 26, 6, 17, 6, 7, 30, 20, 8, 46, 47, 5, 3, 13, 13, 18, 20, 40, 28, 8, 28, 10, 11, 11, 2, 2, 5, 3, 3, 1
            },
                                                   new List <int> {
                1, 5, 1, 3, 2, 2, 2, 1, 3, 4, 1, 1, 5, 5, 5, 2, 2, 4, 3, 1, 3, 5, 1, 3, 1, 4, 1, 2, 4, 4, 2, 1, 5, 5, 4, 1, 1, 2, 3, 5, 5, 5, 5, 2, 1, 4, 3
            },
                                                   15);

            Assert.Equal(660, result);
        }
示例#14
0
        //[Fact]
        public void TestCase6()
        {
            var result = LeadALife.calculateProfit(50,
                                                   new List <int> {
                1, 2, 3, 2, 3, 3, 5, 1, 5, 4, 22, 18, 35, 4, 11, 12, 9, 39, 32, 11, 46, 5, 49, 40, 10, 25, 17, 16, 13, 2, 7, 6, 21, 19, 24, 10, 26, 3, 10, 50, 21, 1, 3, 2, 1, 3, 4, 5, 3, 2
            },
                                                   new List <int> {
                2, 3, 1, 2, 4, 5, 3, 2, 3, 1, 3, 4, 3, 5, 5, 1, 4, 5, 4, 3, 5, 1, 5, 4, 3, 1, 3, 3, 2, 2, 4, 5, 4, 4, 1, 2, 1, 4, 3, 5, 1, 2, 5, 3, 2, 4, 3, 5, 1, 3
            },
                                                   15);

            Assert.Equal(660, result);
        }