Exemple #1
0
        public void GetNumbersTest_PositiveNumber_Success(int arg)
        {
            var expectedResult = new List <int>()
            {
                1, 1, 2, 3, 5, 8, 13
            };
            var result = FibonacciNumbers.GetNumbers(arg).ToList();

            CollectionAssert.AreEqual(expectedResult, result);
        }
        static void Main()
        {
            int i = 0;

            foreach (var number in FibonacciNumbers.GetNumbers(92))
            {
                i++;
                Console.WriteLine("{0}: {1}", i, number);
            }
            Console.ReadKey();
        }
Exemple #3
0
        private static void FibonacciFunctionality()
        {
            var fibonacci = FibonacciNumbers.GetNumbers(6).ToList();

            foreach (var num in fibonacci)
            {
                Console.Write($"{num} ");
            }

            Console.WriteLine();
        }
        public void FibonacciExceptionsTest(int number, Type expectedEx)
        {
            void Result() => FibonacciNumbers.GetNumbers(number).ToList();

            Assert.Throws(expectedEx, Result);
        }
        public void GetNumbersTest(int number, List <int> expectedResult)
        {
            var result = FibonacciNumbers.GetNumbers(number).ToList();

            Assert.That(result, Is.EqualTo(expectedResult));
        }
Exemple #6
0
 public void FibonacciNumbersArgumentExceptionThrown(int length)
 {
     Assert.Throws <ArgumentException>(
         () => FibonacciNumbers.GetNumbers(length));
 }
Exemple #7
0
 public IEnumerable <BigInteger> FibonacciNumbersTest(int length)
 {
     return(FibonacciNumbers.GetNumbers(length));
 }
Exemple #8
0
 public void GetNumbersTest_NegativeNumber_Exception(int arg)
 {
     Assert.Throws <ArgumentException>(() => FibonacciNumbers.GetNumbers(arg).ToList());
 }