Esempio n. 1
0
        public void Benchmark()
        {
            var stopwatch = new Stopwatch();

            stopwatch.Start();

            var result = Fibonacci.Get(90);

            stopwatch.Stop();

            Assert.That(result, Is.EqualTo(2_880_067_194_370_816_120));

            Assert.That(stopwatch.ElapsedMilliseconds, Is.LessThan(5));
        }
Esempio n. 2
0
 public void Returns_nth_fibonacci_number(int n, long expected)
 {
     Assert.That(Fibonacci.Get(n), Is.EqualTo(expected));
 }
Esempio n. 3
0
 public void Rejects_negative_numbers(int n)
 {
     Assert.That(() => Fibonacci.Get(n),
                 Throws.TypeOf <ArgumentOutOfRangeException>());
 }