Beispiel #1
0
        public void Test(int number, int expectedResult)
        {
            var sut    = new EvenFibonacciNumbers();
            var result = sut.Calculate(number);

            Assert.Equal(expectedResult, result);
        }
        public void TestBlah()
        {
            List <int> temp = new List <int>();

            temp = EvenFibonacciNumbers.CreateFibonaccis(13);

            Assert.Contains(1, temp);
            Assert.Contains(2, temp);
            Assert.Contains(3, temp);
            Assert.Contains(5, temp);
            Assert.Contains(8, temp);
        }
        public static void Main(string[] args)
        {
            int problem1 = MultiplesOf3And5.Calculate(1000);

            Console.WriteLine(problem1);

            int problem2 = EvenFibonacciNumbers.Calculate(4000000);

            Console.WriteLine(problem2);

            Console.ReadKey();
        }
Beispiel #4
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");

            Console.WriteLine();

            Console.WriteLine(MultiplesOf3and5.SumOfMultiplesOf3and5(1000));

            Console.WriteLine();

            EvenFibonacciNumbers.RunFib(89);

            Console.WriteLine();

            Console.WriteLine(EvenFibonacciNumbers.SumOfEvenNumbers(4000000));

            Console.WriteLine();

            var primes = GeneratePrimes.GenerateAllPrimesForMaxValue(13195);

            foreach (var prime in primes)
            {
                Console.Write($"{prime} ");
            }

            Console.WriteLine();

            Console.WriteLine(LargestPrimeFactor.FindLargesPrimeFactor(600851475143));

            Console.WriteLine();

            var largestPalindrome = new LargestPalindromeV2(2);

            var product = largestPalindrome.FindLargestPalendromeProduct();

            Console.WriteLine(product);

            Console.WriteLine();
        }
 public void TestOne()
 {
     Assert.AreEqual(4613732, EvenFibonacciNumbers.Solution());
 }