Test-Driven Development in Microsoft .NET (Microsoft Professional)

In this chapter, we demonstrate how to write programmer tests when implementing a data access layer using ADO.NET. We limit the scope of this chapter by implementing only functionality that is needed to implement the data access aspects of the Web service. (See Chapter 4, The Media Library Example for a more complete discussion of the feature.) As you will see, not only do we have to implement the functionality associated with the feature, we have to augment the solution to be able to write tests appropriately. In later chapters, this implementation will evolve to address additional capabilities such as transactions, concurrency, and updates.

Testing the Database Access Layer

Testing a program that accesses data stored in a database has a number of challenges that are different from those we described previously.

By the end of this chapter, you should have a good understanding of the issues associated with writing programmer tests for databases and how some of the issues are mitigated using a combination of capabilities in the .NET Framework and some testing strategies presented here.

Категории