This chapter showed how you can use the unit test framework to define test projects and create test class files using the
TestClass attribute. Each test method should include the
TestMethod attribute. You can also data-bind unit tests using the
DataSource attribute class.
You can write unit tests to verify ASP.NET MVC and Web API controller classes. When doing so, you need to ensure the unit test project references the core client objects required to easily communicate with ASP.NET MVC.
You can also create unit tests that run inside of ASP.NET (either in IIS or the Visual Studio development server). An ASP.NET unit test uses the
TestContext object to access information about the ASP.NET environment, including the executing page, session, ...