Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Unit Tests

Unit Tests

Retired Content

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

The latest Enterprise Library information can be found at the Enterprise Library site.

The Enterprise Library includes two Visual Studio 2005 solution files that include unit tests with the application block projects. One solution file includes NUnit unit tests; the other solution file includes Visual Studio Team System (VSTS) unit tests. You can use the solution files to build the entire Enterprise Library with the unit tests. Table 1 describes the solution files.

Table 1: Solution Files

Configuration

Description

EnterpriseLibrary.VSTS.sln

Contains the entire set of application block projects and the Enterprise Library core projects. Includes all unit tests for execution with the Visual Studio Team System.

EnterpriseLibrary.Nunit.sln

Contains the entire set of application block projects and the Enterprise Library core projects. Includes all unit tests for execution with NUnit.

The Enterprise Library solution files include two build configurations: Release and Debug. All projects within a solution file are compiled in both configurations, including the unit test projects. (For more information, see Building the Enterprise Library.)

Software Requirements

To run the Visual Studio Team System unit tests, you must have Visual Studio Team System version 2005 installed. For more information about Visual Studio Team System, see the Microsoft Visual Studio Team System Web page on MSDN.

To run the NUnit tests, you must have NUnit version 2.2 or later installed. To download NUnit, see the NUnit.org Web site.

Organization

The application block unit tests are in projects that are separate from the application block projects. These projects are located in the UnitTests directory. To give the unit test code access to the application block internal types and members, the application blocks use the InternalsVisibleTo attribute (this is also known as declaring a friend assembly.)

Using the Unit Tests

This release of the Enterprise Library includes a set of solution files marked VSTS and a set marked NUnit. Both sets of solution files contain the same Enterprise Library projects, but they contain different unit test projects. The VSTS solutions contain unit tests that execute using Microsoft Visual Studio Team System; these solution files will not open if you have Standard or Professional editions of Visual Studio (even if you do not want to execute the unit tests). You must have Visual Studio Team System installed to open the VSTS solution files.

The NUnit solutions contain unit tests that execute using NUnit version 2.2. You cannot compile and execute the tests if you do not have NUnit installed; however, you can still open the NUnit solution files in all editions of Visual Studio 2005.

You will not be able to run some of the unit tests if you do not have the Northwind database installed. Some of the unit tests included with Enterprise Library require that the Northwind database be present in the SQL Server instance named .\sqlexpress. The Northwind database does not ship with SQL Server 2005. If you want to run the unit tests that use this database, you can download the scripts to create Northwind from Northwind and pubs Sample Databases for SQL Server 2000.

The scripts that create the databases used by the unit tests (such as CreateCachingDb.cmd and CreateLoggingDb.cmd) all assume that you have a local SQL Server with an instance name of SQLEXPRESS.

Other unit tests may have additional dependencies on services such as Message Queuing or Authorization Manager.

Retired Content

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

The latest Enterprise Library information can be found at the Enterprise Library site.
Show:
© 2015 Microsoft