public ActionResult DisplayFibonacciSequence(FibonacciRequest req) { if (ModelState.IsValid) { var model = new Fibonacci(); model.Sequence = new FibonacciGenerator().Generate(req.num); return View(model); } return View("FibonacciRequest",req); }
public void FiboTest() { FibonacciGenerator f=new FibonacciGenerator(); Fibonacci fib=new Fibonacci(); fib.Sequence = f.Generate(5); List<int> exp = new List<int>(){1,1,2,3,5}; Assert.AreEqual(exp,fib.Sequence); }