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)); }
public void Returns_nth_fibonacci_number(int n, long expected) { Assert.That(Fibonacci.Get(n), Is.EqualTo(expected)); }
public void Rejects_negative_numbers(int n) { Assert.That(() => Fibonacci.Get(n), Throws.TypeOf <ArgumentOutOfRangeException>()); }