August 2010
Intermediate to advanced
1224 pages
34h 17m
English
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.
Visual Studio allows you to generate unit tests from existing code. It also provides the Properties dialog box from Test View to help with generating your test attribute code.
You can write unit tests that are hosted by 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, and server variables.
Writing unit tests can ...