Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
Sample Code
C#
public ActionResult SubjectExpertsList()
        {
            UsersListViewModel model = new UsersListViewModel();
            model.UsersList = _userService.UsersList(Convert.ToInt32(Session["organizationId"]));
            model.UsersList = model.UsersList.Where(u => u.RoleId == 5).ToList();
            return View(model);
        }

I want to test ths model values with my expected value. How?
Posted

Please read below article.May be the starting point for you.Good Luck :)

ASP.NET MVC Unit Testing using NUnit in Visual Studio
 
Share this answer
 
unit testing of the view is not recommended
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900