Nunit addon未显示在Nunit的插件列表中
-
08-10-2019 - |
题
我正在为Nunit创建一个插件而遇到麻烦。我认为我已经完成了必要的步骤,但是由于某些原因,我在Nunit Tools插件列表中没有看到我创建的插件。我从我的nunit安装目录中创建了一个新项目,并引用了nunit.core和nunit.core.interfaces。然后,我将其构建并通过DLL将其复制到Addins目录中。
这是我的班级:
using System;
using System.Text;
using NUnit.Core.Extensibility;
using NUnit.Core;
[NUnitAddinAttribute(Type = ExtensionType.Core, Name = "Test Addin", Description = "A test addin.")]
public class CTestingAddin : IAddin, EventListener
{
#region IAddin Members
public bool Install(IExtensionHost host)
{
IExtensionPoint listeners = host.GetExtensionPoint("EventListeners");
if (listeners == null)
return false;
listeners.Install(this);
return true;
}
#endregion
#region EventListener Members
public void RunStarted(string name, int testCount)
{
}
public void RunFinished(Exception exception)
{
}
public void RunFinished(TestResult result)
{
}
public void SuiteFinished(TestResult result)
{
}
public void SuiteStarted(TestName testName)
{
}
public void TestFinished(TestResult result)
{
}
public void TestOutput(TestOutput testOutput)
{
}
public void TestStarted(TestName testName)
{
Console.WriteLine("EVENTLISTENER: Test has started");
}
public void UnhandledException(Exception exception)
{
}
#endregion
}
打开Nunit时,我在插件中看不到任何东西。任何想法可以使我无法看到此附件并加载它。
谢谢
解决方案
我找到了答案。显然,EventListener并未出现在插件中,我只是进行了测试,即使它没有出现在插件上,也正在运行我的侦听器。
不隶属于 StackOverflow