I setup a very simple project that tests 2 dummy methods. I am able to run the unit test through NCover (console or Explorer) when I specify the unit tested as NUnit and get a coverage file back. However, as soon as I specify TMockRunner to run, I get no coverage file back. I get lots of errrors running the NUnit command line obviously when running my real tests. Please advise.
NCover - NUnit settings:
<xml>
<ProfilerSettings>
<CommandLineExe>C:Program FilesNUnit 2.4.8in
unit-console.exe</CommandLineExe>
<CommandLineArgs>"C:Documents and SettingskriskMy DocumentsVisual Studio 2008ProofsTestWebApplication1inDebugTestWebApplication1.dll" /noshadow /include=UnitTest</CommandLineArgs>
<WorkingDirectory>C:Program FilesNUnit 2.4.8in</WorkingDirectory>
<CoverageXml>Coverage.Xml</CoverageXml>
<XmlFormat>Xml2</XmlFormat>
<NoLog>false</NoLog>
<LogFile>Coverage.log</LogFile>
<VerboseLog>true</VerboseLog>
<ProfileIIS>false</ProfileIIS>
<RegisterForUser>true</RegisterForUser>
<CoverageHtmlPath>CoverageReports</CoverageHtmlPath>
</ProfilerSettings>
NCover - TMockrunner settings:
<xml>
<ProfilerSettings>
<CommandLineExe>C:Program FilesTypemockIsolator.1TMockRunner.exe</CommandLineExe>
<CommandLineArgs>"C:Program FilesNUnit 2.4.8in
unit-console.exe" "C:Documents and SettingskriskMy DocumentsVisual Studio 2008ProofsTestWebApplication1inDebugTestWebApplication1.dll" /noshadow /include=UnitTest</CommandLineArgs>
<WorkingDirectory>C:Program FilesNUnit 2.4.8in</WorkingDirectory>
<CoverageXml>Coverage.Xml</CoverageXml>
<XmlFormat>Xml2</XmlFormat>
<NoLog>false</NoLog>
<LogFile>Coverage.log</LogFile>
<VerboseLog>true</VerboseLog>
<ProfileIIS>false</ProfileIIS>
<RegisterForUser>true</RegisterForUser>
<CoverageHtmlPath>CoverageReports</CoverageHtmlPath>
</ProfilerSettings>
simple website project:
namespace WebApplication1
{
public class Dummy
{
public object MethodX(bool doIt)
{
if (doIt)
return new object();
else
return null;
}
public void MethodY()
{
//don't do anything
}
}
}
simple test:
using NUnit.Framework;
namespace TestWebApplication1
{
[TestFixture]
public class Class1
{
[Test, Category("UnitTest")]
public void Test_MethodX()
{
WebApplication1.Dummy d = new WebApplication1.Dummy();
object x = d.MethodX(true);
Assert.IsNotNull(x);
}
[Test, Category("UnitTest")]
public void Test_MethodY()
{
WebApplication1.Dummy d = new WebApplication1.Dummy();
d.MethodY();
}
}
}
[/code]