public void FibonacciNumberTest5()
        {
            MyRedPill redPill = new MyRedPill();
            long      result  = redPill.FibonacciNumber(-2);

            Assert.AreEqual(result, -1);
        }
Exemplo n.º 2
0
        public void FibonacciNumberTest()
        {
            var svc = new MyRedPill();

            var result = svc.FibonacciNumber(3);

            Assert.AreEqual(2, result, "Fibonacci calculation incorrect");

            result = svc.FibonacciNumber(-5);
            Assert.AreEqual(-5, result, "Fibonacci calculation incorrect");

            result = svc.FibonacciNumber(0);
            Assert.AreEqual(0, result, "Fibonacci calculation incorrect");

            result = svc.FibonacciNumber(1);
            Assert.AreEqual(1, result, "Fibonacci calculation incorrect");

            result = svc.FibonacciNumber(6);
            Assert.AreEqual(8, result, "Fibonacci calculation incorrect");
        }
Exemplo n.º 3
0
        public void FibonacciNumberExceptionTest()
        {
            var svc = new MyRedPill();

            try
            {
                var result = svc.FibonacciNumber(95);
            }
            catch (Exception ex)
            {
                Assert.AreEqual("Fib(>92) will cause a 64-bit integer overflow.", ex.Message);
            }
        }
 public void FibonacciNumberTest6()
 {
     MyRedPill redPill = new MyRedPill();
     long      result  = redPill.FibonacciNumber(-93);
 }
        public void FibonacciNumberTest1()
        {
            MyRedPill redPill = new MyRedPill();

            redPill.FibonacciNumber(93);
        }