Page tree
Skip to end of metadata
Go to start of metadata

To run the DataLib Unit Tests, follow these steps:

1) Deploy the desired DataLib and DataLibTests code 

2) Load DataLib\MigrationSUpport.DataLib.sln, which includes both implementation DataLib.csproj and Unit Test DataLibTests.csproj files 

3) Make sure DataLib.dll is strongly named so it can trust the tests.  Use DataLib.snk; See DataLib\AssemblyInfo


4) Set connection string: C:\gmTools\gmRuntime\MigrationSupport\MigrationSupport\DataLibTests\HelperFunctions.cs

namespace MigrationSupportTests
public static class HelperFunctions
	// public static string LTCConnect = "Data Source=localhost\\SQLEXPRESS;User Id=stocks_login;Password=password;Initial Catalog=stocks_DataLibTests";
	public static string LTCConnect = "Data Source=localhost;User Id=stocks_login;Password=password;Initial Catalog=stocks";

5) Make sure the test project references the datalib project

6) Clean and Rebuild Entire solution

7) Set debugger to NOT stop on any exceptions either when thrown or when unhandled

Encountering unexpected exceptions will cause a fail.  

Not encountering an expected exception will cause a test to fail.

See for example tests named *_Throws_Exception

7) Click Test/Windows/Test View

8) Select all Tests

9) Click Run all Test

Screen should look like this:


  • No labels