I have just purchased an enterprise license because I decided I needed to be able to use NCover for the project I am working on.
The problem I am running into is the tests fail when run under NCover but not when I run them without NCover.
I am using NUnit as my testing framework, and have entered my license code in the configuration utility, selected NCover 1.3 and linked it. I have tried to use NCover version 1.3.3 and 1.5 beta (both 1 and 2) with no luck.
An example of the errors I get under NCover is
1) Ulta.Server.MasData.DataQueueTests.LoadQueue : Ulta.Lib.AppException.UltaException : Object reference not set to an instance of an object.
TearDown : TypeMock.VerifyException :
TypeMock Verification: Expected a new instance of Ulta.Lib.Data.DBManager (try using MockAll)
Method Ulta.Lib.Data.DBManager.AddProc() has 2 more expected calls
Method Ulta.Lib.Data.DBManager.ExecuteCommand() has 2 more expected calls
Method Ulta.Lib.Data.DBManager.CreateConnection() has 1 more expected calls
Method Ulta.Lib.Data.DBManager.AddNumberParam() has 2 more expected calls
at Ulta.Lib.Configuration.ConfigurationManager.GetValue(String sName, String& sValue) in F:System.netKernelLibConfigurationManagerConfigurationManager.cs:line 90
at Ulta.Lib.ResourceInfo.ResourceManager.Initialize() in F:System.netKernelLibResourceManagerResourceManager.cs:line 130
at Ulta.Lib.ResourceInfo.ResourceManager.FindResource(String sResourceID, DataRow& drResourceRow) in F:System.netKernelLibResourceManagerResourceManager.cs:line 351
at Ulta.Lib.ResourceInfo.ResourceManager.GetResource(String sResourceID, DatabaseResource& databaseResource) in F:System.netKernelLibResourceManagerResourceManager.cs:line 160
at Ulta.Lib.Data.DBManager.CreateConnection(ResourceManager ResMgr, String LogicalName)
at Ulta.Server.MasData.DataQueue..ctor(Parameters Parameters) in W:WorkMasData.NetMasDataDllDataQueue.cs:line 49
at Ulta.Server.MasData.DataQueueTests.LoadQueue() in W:WorkMasData.NetMasDataTestsDataQueueTests.cs:line 138
--TearDown
at TypeMock.MockManager.Verify()
at Ulta.Server.MasData.DataQueueTests.TestTearDown() in W:WorkMasData.NetMasDataTestsDataQueueTests.cs:line 104
I have tried changing the call to MockAll with the same results. This only occur when run with the command line:
"c:program files
cover
cover.console" /c "C:Program FilesNUnitin
unit-console.exe" MasDataTests.dll
If I run
"C:Program FilesNUnitin
unit-console.exe" MasDataTests.dll
it all works fine, all tests succeed.
I tried turning verbose on (set TMOCK_VERBOSE=1) and looking at the TypeMock.out that is the NCover directory but there is no IL code in that file to send along.
I am sure I am missing something, but can't figure out what it is. I have use NCover before without TypeMock successfully, so I am at a loss here.
Darryn Glass