asp.net mvc - Difficulty to start up with basic unit test (Sample from my book -- SportsStore) -
i'm new in tdd and, actually, i'm trying follow sample book (sportsstore -- pro asp.net mvc framework/steve sanderson/apress). i'm on pages 103-105.
although there more on this, new of this, i'm concerned following statements.
productscontroller controller = new productscontroller(repository); var result = controller.list(2); //...
regarding above statements, when write (as in book),
var products = result.viewdata.model ilist<product>;
i compiler error "system.web.mvc.actionresult" not contain definition viewdata ..." but, when remove list() statement, compiler error disapear.
var result = controller.list(2);//doesn't work var result = controller;//it works
is wrong there? checked apress website book, there nothing listed errata or issue. so i'm lost.
thanks helping
that because actionresult not contains definition viewdata howerver viewresult , viewresult actionresult can cast (viewresult) , viewdata
Comments
Post a Comment