示例#1
0
        /// <summary>
        /// Registers this type as a SuiteBuilder for NUnit tests.
        /// </summary>
        public bool Install(IExtensionHost host)
        {
            IExtensionPoint suiteBuilders = host.GetExtensionPoint("SuiteBuilders");

            suiteBuilders.Install(this);
            return(true);
        }
示例#2
0
        public bool Install(IExtensionHost host)
        {
            IExtensionPoint listeners = host.GetExtensionPoint("EventListeners");

            listeners.Install(this);
            return(true);
        }
示例#3
0
 /// <summary>
 /// Installs a new suite builder extension.
 /// </summary>
 /// <param name="extension">The suite builder extension to be installed.</param>
 /// <param name="append">Indicates whether the suite builder extension is
 /// to be installed with a lower priority than all existing suite builder extensions
 /// (a <c>true</c> value) or with a higher priority than all existing suite
 ///  builder extensions (a <c>false</c> value).
 /// </param>
 public void Install(ISuiteBuilder extension, bool append)
 {
     _extensionPoint.Install(extension);
     if (!append && _items != null)
     {
         _items.Remove(extension);
         _items.Insert(0, extension);
     }
 }
示例#4
0
        public bool Install(IExtensionHost host)
        {
            IExtensionPoint listeners = host.GetExtensionPoint("EventListeners");

            if (listeners == null)
            {
                return(false);
            }
            listeners.Install(this);
            return(true);
        }
        public bool Install(IExtensionHost host)
        {
            IExtensionPoint extensionPoint = host.GetExtensionPoint("SuiteBuilders");

            if (extensionPoint == null)
            {
                return(false);
            }
            extensionPoint.Install(this);
            return(true);
        }
示例#6
0
文件: Addin.cs 项目: stantoxt/nunitv2
        public bool Install(IExtensionHost host)
        {
            IExtensionPoint builders = host.GetExtensionPoint("SuiteBuilders");

            if (builders == null)
            {
                return(false);
            }

            builders.Install(new SampleSuiteExtensionBuilder());
            return(true);
        }
示例#7
0
        public bool Install(IExtensionHost host)
        {
            IExtensionPoint listeners = host.GetExtensionPoint("EventListeners");

            if (listeners == null)
            {
                return(false);
            }

            listeners.Install(new NUnitTestManager());
            return(true);
        }
    //some private attributes to hold important data

    //you must provide the Install method
    public bool Install(IExtensionHost host)
    {
        //I also built my connection string in here
        IExtensionPoint listeners = host.GetExtensionPoint("EventListeners");

        if (listeners == null)
        {
            return(false);
        }
        listeners.Install(this);
        return(true);
    }
        public bool Install(IExtensionHost host)
        {
            IExtensionPoint decorators = host.GetExtensionPoint("TestDecorators");

            if (decorators == null)
            {
                return(false);
            }

            decorators.Install(this);
            return(true);
        }
        public bool Install(IExtensionHost host)
        {
            IExtensionPoint testCaseBuilders = host.GetExtensionPoint("SuiteBuilders");

            if (testCaseBuilders == null)
            {
                return(false);
            }

            testCaseBuilders.Install(this);
            return(true);
        }
示例#11
0
    public bool Install(IExtensionHost host)
    {
        IExtensionPoint testCaseProviders = host.GetExtensionPoint("TestCaseProviders");

        if (testCaseProviders == null)
        {
            return(false);
        }
        testCaseProviders.Install(new AutoMoqDataProvider());
        ReplaceTestCaseProvidersWithWrapper(testCaseProviders);
        return(true);
    }
示例#12
0
        public bool Install(IExtensionHost host)
        {
            System.Diagnostics.Trace.WriteLine("MaxTimeDecorator: Install called");
            IExtensionPoint decorators = host.GetExtensionPoint("TestDecorators");

            if (decorators == null)
            {
                return(false);
            }

            decorators.Install(this);
            return(true);
        }
示例#13
0
        public void CanAddDecorator()
        {
            DynamicMock mock = new DynamicMock(typeof(ITestDecorator));

            mock.Expect("Decorate");

            IExtensionPoint ep = host.GetExtensionPoint("TestDecorators");

            ep.Install(mock.MockInstance);
            host.TestDecorators.Decorate(null, null);

            mock.Verify();
        }
示例#14
0
        public void CanAddSuiteBuilder()
        {
            DynamicMock mock = new DynamicMock(typeof(ISuiteBuilder));

            mock.ExpectAndReturn("CanBuildFrom", true, null);
            mock.Expect("BuildFrom");

            IExtensionPoint ep = host.GetExtensionPoint("SuiteBuilders");

            ep.Install(mock.MockInstance);
            host.SuiteBuilders.BuildFrom(null);

            mock.Verify();
        }
示例#15
0
        public void CanAddDecorator()
        {
            ITestDecorator mockDecorator = Substitute.For <ITestDecorator>();

            IExtensionPoint ep = host.GetExtensionPoint("TestDecorators");

            ep.Install(mockDecorator);

            ITestDecorator decorators = (ITestDecorator)ep;

            decorators.Decorate(null, null);

            mockDecorator.Received().Decorate(null, null);
        }
示例#16
0
        public void CanAddEventListener()
        {
            EventListener mockListener = Substitute.For <EventListener>();

            IExtensionPoint ep = host.GetExtensionPoint("EventListeners");

            ep.Install(mockListener);
            EventListener listeners = (EventListener)ep;

            listeners.RunStarted("test", 0);
            mockListener.Received().RunStarted("test", 0);

            listeners.RunFinished(new TestResult(new TestInfo(new TestSuite("test"))));
            mockListener.Received().RunFinished(Arg.Is <TestResult>(x => x.Name == "test"));
        }
示例#17
0
        public void CanAddTestCaseBuilder2()
        {
            ITestCaseBuilder2 mockBuilder = Substitute.For <ITestCaseBuilder2>();

            mockBuilder.CanBuildFrom(null, null).Returns(true);

            IExtensionPoint ep = host.GetExtensionPoint("TestCaseBuilders");

            ep.Install(mockBuilder);
            ITestCaseBuilder2 builders = (ITestCaseBuilder2)ep;

            builders.BuildFrom(null, null);

            mockBuilder.Received().BuildFrom(null, null);
        }
示例#18
0
        public bool Install(IExtensionHost host)
        {
            IExtensionPoint suiteBuilders = host.GetExtensionPoint("SuiteBuilders");
            IExtensionPoint testBuilders  = host.GetExtensionPoint("TestCaseBuilders");
            IExtensionPoint events        = host.GetExtensionPoint("EventListeners");

            if (events == null)
            {
                return(false);
            }

            events.Install(this);

            return(true);
        }
示例#19
0
        public bool Install(IExtensionHost host)
        {
            if (host == null)
            {
                throw new ArgumentNullException("MyExtension.Install() method has failed beacuse 'host' is NULL");
            }
            IExtensionPoint listeners = host.GetExtensionPoint("EventListeners");

            if (listeners == null)
            {
                return(false);
            }
            listeners.Install(this);
            return(true);
        }
示例#20
0
        public void CanAddSuiteBuilder()
        {
            ISuiteBuilder mockBuilder = Substitute.For <ISuiteBuilder>();

            mockBuilder.CanBuildFrom(Arg.Any <Type>()).Returns(true);

            IExtensionPoint ep = host.GetExtensionPoint("SuiteBuilders");

            ep.Install(mockBuilder);
            ISuiteBuilder builders = (ISuiteBuilder)ep;

            builders.BuildFrom(null);

            mockBuilder.Received().BuildFrom(null);
        }
示例#21
0
        public void CanAddEventListener()
        {
            DynamicMock mock = new DynamicMock(typeof(EventListener));

            mock.Expect("RunStarted");
            mock.Expect("RunFinished");

            IExtensionPoint ep = host.GetExtensionPoint("EventListeners");

            ep.Install(mock.MockInstance);
            host.Listeners.RunStarted("test", 0);
            host.Listeners.RunFinished(new TestSuiteResult(null, "test"));

            mock.Verify();
        }
示例#22
0
        public bool Install(IExtensionHost host)
        {
            CTATestCaseBuilder builder = new CTATestCaseBuilder(host, screenCapture);

            host.GetExtensionPoint("TestCaseBuilders").Install(builder);

            IExtensionPoint listeners = host.GetExtensionPoint("EventListeners");

            if (listeners == null)
            {
                return(false);
            }

            listeners.Install(this);
            return(true);
        }
示例#23
0
        public void CanAddTestCaseBuilder2()
        {
            DynamicMock mock = new DynamicMock(typeof(ITestCaseBuilder2));

            mock.ExpectAndReturn("CanBuildFrom", true, null);
            mock.Expect("BuildFrom");

            IExtensionPoint ep = host.GetExtensionPoint("TestCaseBuilders");

            ep.Install(mock.MockInstance);
            ITestCaseBuilder2 builders = (ITestCaseBuilder2)ep;

            builders.BuildFrom(null, null);

            mock.Verify();
        }
示例#24
0
        public bool Install(IExtensionHost host)
        {
            if (host == null)
            {
                throw new ArgumentNullException("host");
            }

            IExtensionPoint testCaseBuilders = host.GetExtensionPoint("TestCaseBuilders");

            if (testCaseBuilders == null)
            {
                return(false);
            }

            testCaseBuilders.Install(this);
            return(true);
        }
        //TestCaseInspector tci = new TestCaseInspector();

        #region IAddin Members

        public bool Install(IExtensionHost host)
        {
            FileInfo configFile = new FileInfo(@".\NunitTestLinkExporterLog.xml");

            //XmlConfigurator.Configure(configFile); //(logConfigUri);
            log.Debug("Starting install");

            exporter = new ResultExporter();
            IExtensionPoint listeners = host.GetExtensionPoint("EventListeners");

            listeners.Install(exporter);

            //IExtensionPoint testCaseBuilderEP = host.GetExtensionPoint("TestCaseBuilders");
            //testCaseBuilderEP.Install(tci);

            return(true);
        }
示例#26
0
        public bool Install(IExtensionHost host)
        {
            if (host == null)
            {
                throw new ArgumentNullException("host");
            }

            IExtensionPoint listeners = host.GetExtensionPoint("EventListeners");

            if (listeners == null)
            {
                return(false);
            }

            listeners.Install(this);
            return(true);
        }
示例#27
0
        public bool Install(IExtensionHost host)
        {
            if (host == null)
            {
                throw new ArgumentNullException("host");
            }

            IExtensionPoint parameterProviders = host.GetExtensionPoint("ParameterProviders");

            if (parameterProviders == null)
            {
                return(false);
            }

            parameterProviders.Install(CreateParameterProvider());
            return(true);
        }
示例#28
0
        public bool Install(IExtensionHost host)
        {
            #region Argument Check

            if (host == null)
            {
                throw new ArgumentNullException("host");
            }

            #endregion

            IExtensionPoint eventListenersPoint = host.GetExtensionPoint("EventListeners");
            if (eventListenersPoint == null)
            {
                return(false);
            }

            eventListenersPoint.Install(this);
            return(true);
        }
        public bool Install(IExtensionHost host)
        {
            IExtensionPoint decorators = host.GetExtensionPoint("EventListeners");

            if (decorators == null)
            {
                return(false);
            }

            s = new SocketAPI();

            t           = new System.Timers.Timer();
            t.Elapsed  += new ElapsedEventHandler(t_Elapsed);
            t.Interval  = CAPTURE_TIME_IN_SECONDS * 1000 * 0.8;
            m           = new Mutex(false);
            t.AutoReset = false;
            testRunning = false;
            decorators.Install(this);

            return(true);
        }
        public bool Install(IExtensionHost host)
        {
            if (!registeredListeners)
            {
                if (host == null)
                {
                    throw new ArgumentNullException("host");
                }

                IExtensionPoint listeners = host.GetExtensionPoint("EventListeners");
                if (listeners == null)
                {
                    return(false);
                }

                listeners.Install(new TestEventListener());
                registeredListeners = true;
                return(true);
            }
            else
            {
                return(true);
            }
        }