Testing Steps:
Testing Under NUnit 2.2.6 for .NET 1.1
NCover 1.3.3
TypeMock 3.0.1
Entered my Registration for TypeMock
Created a new VS 2003 project for testing.
Ran my test suite (in NUnit Gui). Ran Successfully.
Linked TypeMock to NCover 1.3
Closed TypeMock Configuration Tool.
Ran my test suite (in NUnit Gui). Ran Successfully.
Ran my test suite (in NUnit Console). Ran Successfully.
Ran the command
"c:program files
cover
cover.console" /c "C:Program FilesNUnitin
unit-console.exe" MockedTests.dll /a ToBeMockedDLL
Ran Successfully but with no output in the coverage.xml file
<?xml version="1.0" ?>
<?xml-stylesheet href="coverage.xsl" type="text/xsl" ?>
<coverage>
</coverage>
Upgraded NCover to 1.5.1 beta 2
Added this line to typemockcondfig.xml
<Profiler Name="NCover1.5" Clsid="{6287B5F9-08A1-45E7-9498-B5B2E7B02995}" DirectLaunch="false">
<EnvironmentList />
</Profiler>
Relinked TypeMock to NCover 1.5
Closed TypeMock Configuration
Ran my test suite (in NUnit Gui). Tests Ran Successfully but NUnit GUI Crashed on exit.
Ran my test suite (in NUnit Console). Nunit Console Crashed on first Run.
Unlinked NCover 1.5.
Ran my test suite (in NUnit Gui). Ran Successfully.
Ran my test suite (in NUnit Console). Ran Successfully.
Relinked TypeMock to NCover 1.5
Closed TypeMock Configuration
Ran the Command (since the GUI will at least run)
"c:program files
cover
cover.console" "C:Program FilesNUnitin
unit-gui.exe" MockedTests.dll //a ToBeMockedDLL
Received the error
NCover.Console.exe - Fatal Error
CLR error: 80004005
The Program will now terminate
Here is the code I am "testing"
using System;
namespace ToBeMockedDLL
{
/// <summary>
/// Summary description for IMockedClass.
/// </summary>
public class MockedClass
{
public MockedClass()
{
}
public int RandomNumber()
{
Random rand = new Random();
int result = Convert.ToInt32(rand.Next());
return result;
}
public int RandomNumber(int Max)
{
Random rand = new Random();
int result = Convert.ToInt32(rand.Next(Max));
return result;
}
public int RandomNumber(int Min, int Max)
{
Random rand = new Random();
int result = Convert.ToInt32(rand.Next(Min, Max));
return result;
}
}
/// <summary>
/// Summary description for Dice.
/// </summary>
public class Dice
{
MockedClass mocked;
public Dice()
{
mocked = new MockedClass();
}
public int Rolld6(int count)
{
int result = 0; // Can't get 0 from dice
if (count < 1)
throw new ArgumentNullException("You must have at least 1 die to roll");
for (int number = 0; number < count; ++number)
{
result += mocked.RandomNumber(1,6);
}
return result;
}
public int Rolld10(int count)
{
int result = 0; // Can't get 0 from dice
if (count < 1)
throw new ArgumentNullException("You must have at least 1 die to roll");
for (int number = 0; number < count; ++number)
{
result += mocked.RandomNumber(1,10);
}
return result;
}
public int Rolld100(int count)
{
int result = 0; // Can't get 0 from dice
if (count < 1)
throw new ArgumentNullException("You must have at least 1 die to roll");
for (int number = 0; number < count; ++number)
{
result += mocked.RandomNumber(1,100);
}
return result;
}
}
}
Here is my test code
using System;
using ToBeMockedDLL;
using NUnit.Framework;
using TypeMock;
namespace MockedTests
{
/// <summary>
/// Summary description for Class1.
/// </summary>
[TestFixture]
public class Tests
{
[SetUp]
public void TestSetup()
{
MockManager.Init();
}
[TearDown]
public void TestTearDown()
{
MockManager.Verify();
}
[Test]
public void Roll1d6()
{
Mo