Creating a Test Project

The first step in the Test Driven Development approach is creating a Test Project (close any currently opened projects) related to a project you are working on. By remembering the lesson learned in the previous section, follow these steps:

1. Create a new class library named RectangleLibrary and remove the Class1.vb default file.

2. Add a new test project to the solution. To accomplish this, select File, Add, New project, and then in the Visual Basic, Test folder, select the Unit Test Project template.

3. Rename the default class RectangleTest.vb. This is the place where you write and run unit tests.

Now imagine you want to test a Rectangle class exposing Width and Height properties and methods for math calculations such ...

Get Visual Basic 2015 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.