Код: Выделить всё
using System.IO;
using NUnit.Engine;
using NUnit.Engine.Extensibility;
namespace Learning.NUnitInterface
{
[Extension(Description = "My Test Listener", Path = "EventListeners")]
public class MyTestListener : ITestEventListener
{
public MyTestListener()
{
try
{
//Directory.CreateDirectory(@"C:\temp");
//File.WriteAllText(@"C:\temp\addin_loaded.txt", "Loaded");
}
catch
{
// ignore errors
}
}
public void OnTestEvent(string report)
{
}
}
}
Внутри папки TestCentric.GuiRunner.2.0.0-beta7\tools я добавил файл Extensibility.addins и введите внутри: Extensions/ClassLibrary3/tools/*.dll
Когда я запускаю testcentric.exe я получаю сообщение об ошибке ссылки на объект.
в журнале (InternalTrace.27864) я получаю сообщение об ошибке:
Код: Выделить всё
4:54:34.414 Debug [ 1] ExtensionManager: Type: - not an extension
14:54:34.414 Info [ 1] ExtensionManager: Type: MyTestListener - found ExtensionAttribute
14:54:34.418 Error [ 1] ServiceManager: Failed to initialize ExtensionService
14:54:34.421 Error [ 1] ServiceManager: System.NullReferenceException: Object reference not set to an instance of an object.
14:54:34.409 Info [ 1] ExtensionManager: Assembly: ClassLibrary3.dll
14:54:34.414 Debug [ 1] ExtensionManager: Type: - not an extension
14:54:34.414 Info [ 1] ExtensionManager: Type: MyTestListener - found ExtensionAttribute
14:54:34.418 Error [ 1] ServiceManager: Failed to initialize ExtensionService
14:54:34.421 Error [ 1] ServiceManager: System.NullReferenceException: Object reference not set to an instance of an object.
at TestCentric.Extensibility.ExtensionManager.FindExtensionsInAssembly(ExtensionAssembly extensionAssembly)
at TestCentric.Extensibility.ExtensionManager.FindExtensions(String startDir)
at TestCentric.Engine.Services.ExtensionService.StartService()
at TestCentric.Engine.Services.ServiceManager.StartService(IService service)
Подробнее здесь: https://stackoverflow.com/questions/798 ... ric-beta-7
Мобильная версия