Exemple #1
0
        public void DisabledExtensionMayBeEnabled()
        {
            _serviceInterface.EnableExtension("NUnit.Engine.Tests.DummyDisabledExtension", true);

            Assert.That(_serviceInterface.Extensions,
                        Has.One.Property(nameof(ExtensionNode.TypeName)).EqualTo("NUnit.Engine.Tests.DummyDisabledExtension")
                        .And.Property(nameof(ExtensionNode.Enabled)).True);
        }
        public void DisabledExtensionMayBeEnabled()
        {
            _serviceInterface.EnableExtension("NUnit.Engine.Tests.DummyDisabledExtension", true);
            foreach (var node in _serviceInterface.Extensions)
            {
                if (node.TypeName == "NUnit.Engine.Tests.DummyDisabledExtension")
                {
                    Assert.True(node.Enabled, "Failed to enable extension");
                    return;
                }
            }

            Assert.Fail("Could not find DummyDisabledExtension");
        }
Exemple #3
0
        public ConsoleRunner(ITestEngine engine, ConsoleOptions options, ExtendedTextWriter writer)
        {
            _engine    = engine;
            _options   = options;
            _outWriter = writer;

            _workDirectory = options.WorkDirectory ?? Directory.GetCurrentDirectory();

            if (!Directory.Exists(_workDirectory))
            {
                Directory.CreateDirectory(_workDirectory);
            }

            _resultService    = _engine.Services.GetService <IResultService>();
            _filterService    = _engine.Services.GetService <ITestFilterService>();
            _extensionService = _engine.Services.GetService <IExtensionService>();

            // Enable TeamCityEventListener immediately, before the console is redirected
            _extensionService?.EnableExtension("NUnit.Engine.Listeners.TeamCityEventListener", _options.TeamCity);
        }
Exemple #4
0
        public ConsoleRunner(ITestEngine engine, ConsoleOptions options, ExtendedTextWriter writer)
        {
            _engine = engine;
            _options = options;
            _outWriter = writer;

            _workDirectory = options.WorkDirectory;

            if (_workDirectory == null)
                _workDirectory = Environment.CurrentDirectory;
            else if (!Directory.Exists(_workDirectory))
                Directory.CreateDirectory(_workDirectory);

            _resultService = _engine.Services.GetService<IResultService>();
            _filterService = _engine.Services.GetService<ITestFilterService>();
            _extensionService = _engine.Services.GetService<IExtensionService>();

            // Enable TeamCityEventListener immediately, before the console is redirected
            _extensionService.EnableExtension("NUnit.Engine.Listeners.TeamCityEventListener", _options.TeamCity);
        }