Test Plan

The Repository Factory is tested by automated and manual tests.

Automated Testing

The Repository Factory is currently using NUnit as the unit testing framework. The original source code drop from Microsoft was using Microsoft Tests (only supported in Visual Studio Team System edition). The reason to change to NUnit is to allow developers using other editions of Visual Studio to write and run their unit tests. Also, NUnit is a widely adopted testing framework and it is supported by other tools such as Resharper.

Developers and Unit Tests

Unit Testing Areas

The Repository Factory can be basically divided into three areas of unit testing:

Manual Testing

Test Projects

The testing solutions are located under the Repository Factory source code at: These solutions are available as of change set # 23234.

Testing Database

The following database servers are required for this test plan: We are using the Chinook Sample Database which provide scripts for SQL Server and Oracle:

Test Plan

The following test plan should be performed in 4 runs:

Test Plan Steps

  1. Restore the Test project.
  2. Run the Specify project responsibility Recipe.
    1. Right click on the DataAccessCS/DataAccessVB and select Specify project responsibility.
    2. Select all three responsibility options and press OK.
    3. Verify that all recipes are available on the context menu.
  3. Run the Add database connection Recipe.
    1. Name the connection as MyConnection (needed in order to run the unit tests below).
    2. Use the Chinook database created on the Testing Database section above.
    3. Verify that app.config was created with the connection string was added.
  4. Run the Create CRUD stored procedures Recipe.
    1. Select MyConnection as connection name and click on Next.
    2. Select all database tables and accept all default settings.
    3. Execute the generated SQL script in order to create the stored procedures. In SQL Server, you can execute it by opening a command prompt window and running: osql -E -S .\sqlexpress -i StoredProcedures.sql -d "Chinook".
  5. Run the Create business entities from database Recipe.
    1. Select MyConnection as connection name and click on Next.
    2. Leave the default namespace and click on Next.
    3. Select all tables available and click on Next, and then on Finish.
    4. Compile the solution to verify that there are no errors.
  6. Run the Create data repository classes from business entities Recipe.
    1. Select MyConnection as connection name and click on Next twice.
    2. Select all business entities created on the previous step and click on Next.
    3. Select the Album entity and click on Add... / Get One.
    4. Select the GetAlbumByAlbumId stored procedure, and click on Next and Finish.
    5. Click on Finish to end the recipe.
    6. Compile the solution to verify that there are no errors.
  7. Run the solution Unit Tests
    1. On the DataAccess.Test project, click on the RepositoryTests.cs file and change its property Build Action to Compile.
    2. Make sure your connection name is MyConnection, if not rename it on your app.config or change it on RepositoryTests class.
    3. Rebuild the solution and run all unit tests.