csci3081/testing/fibonacci_test.cc

21 lines
441 B
C++
Raw Normal View History

2018-01-29 23:24:20 +00:00
#include <iostream>
#include "fibonacci.h"
#include "tests.h"
void fibonacci_unittest() {
// test negative
ExpectEqual("Negative Input", fibonacci(-1), -1);
// test 0
ExpectEqual("0 Input", fibonacci(0), 0);
// test boundary
ExpectEqual("Border 1", fibonacci(1), 1);
ExpectEqual("Border 2", fibonacci(2), 2);
// test typical
ExpectEqual("Typical 5", fibonacci(5), 5);
ExpectEqual("Typical 10", fibonacci(10), 55);
}