I'm returning a list to my MVC controller from Massive. When I'm in my test how can I check that there are 3 records (as expected) in the returned list?
My test code currently returns the 3 records from a call and populates into my ViewModel (model) but when I try to run .Count()
it's saying object has no Count
method. Since it's a dynamic
type what do I do?
My test code:
var result = _controller.Index() as ViewResult;
var model = result.Model as MyExperienceListModel;
Assert.AreEqual(3, model.Experience.Count());
model.Experience is dynamic
btw.