Creating a test library

Once you get the hang of writing tests, you're going to want to write a lot of tests, so that you can maximize the test coverage of your application.

When you write a lot of tests, you'll probably notice quickly that you are creating the same data over and over. It's very important for a test to create the data that it needs for the test, or else you run the risk of having too much reliance on the environment that the test is run in.

The best way to tackle this is to make use of test libraries, which allow you to consolidate the common functions used across your tests and create a set of standardized functions so that all of your tests follow the same process flow.

This recipe will show you how to create and make use of a test library.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset