O'Reilly logo

Microsoft Visual Studio 2015 Unleashed, Third Edition by Mike Snell, Lars Powers

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Summary

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, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required