コード例 #1
0
 public void TestRun()
 {
     Assert.AreEqual(648, LargestProductInSeries.Start(3));
     Assert.AreEqual(5832, LargestProductInSeries.Start(4));
     Assert.AreEqual(40824, LargestProductInSeries.Start(5));
     Assert.AreEqual(285768, LargestProductInSeries.Start(6));
     Assert.AreEqual(23514624000, LargestProductInSeries.Start(13));
 }
コード例 #2
0
        public void TestTwo()
        {
            Assert.AreEqual(8, 2 * 4);
            Assert.AreEqual(0, 2 * 0 * 1 * 6 * 5);
            Assert.AreEqual(5832, 9 * 9 * 8 * 9);
            //Assert.AreEqual(8, 2 * 4);

            Assert.AreEqual(8, LargestProductInSeries.CreateAdjacentChunks("73167176531330624919", 13).Count);
        }
コード例 #3
0
        public void TestOne()
        {
            Assert.AreEqual(2, LargestProductInSeries.CreateAdjacentChunks("71636", 4).Count);
            Assert.AreEqual(7, LargestProductInSeries.CreateAdjacentChunks("7316717653", 4).Count);

            List <List <int> > temp = LargestProductInSeries.CreateAdjacentChunks("7316717653", 4);

            foreach (List <int> l in temp)
            {
                Assert.AreEqual(4, l.Count);
            }

            Assert.Contains(new List <int>()
            {
                7, 3, 1, 6
            }, temp);
        }