Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Manning.The.Art.of.Unit.Testing.with.Examples.in.dot.NET.Jun.2009.pdf
Скачиваний:
19
Добавлен:
21.03.2016
Размер:
9.67 Mб
Скачать

6

Test hierarchies and organization

This chapter covers

Running unit tests during automated nightly builds

Using continuous integration for automated builds

Organizing tests in a solution

Exploring test class inheritance patterns

nit tests are as important to an application as the production source code. UAs with the regular code, you need to give careful thought to where the tests reside, both physically and logically, in relation to the code under test. If you put the tests in the wrong place, the tests you’ve written so

carefully may not be run.

Similarly, if you don’t devise ways to reuse parts of your tests, create utility methods for testing, or use test hierarchies, you’ll end up with test code that’s either unmaintainable or hard to understand.

This chapter addresses these issues with patterns and guidelines that will help you shape the way your tests look, feel, and run, and will affect how well they play with the rest of your code and with other tests.

Where the tests are located depends on where they will be used and who will run them. There are two common scenarios: tests run as part of the automated build process, and tests run locally by developers on their own

141

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]