Exemplo n.º 1
0
 public void DiscoverTests(
     IEnumerable <string> sources,
     IDiscoveryContext discoveryContext,
     IMessageLogger logger,
     ITestCaseDiscoverySink discoverySink)
 {
     TestDiscoverer.DiscoverTests(sources, discoveryContext, logger, discoverySink);
 }
 public void VerifyLoading()
 {
     // Load the NUnit empty-assembly.dll once for this test
     nunittestDiscoverer = ((ITestDiscoverer) new NUnitTestDiscoverer());
     nunittestDiscoverer.DiscoverTests(
         new[] { EmptyAssemblyPath },
         new FakeDiscoveryContext(),
         new MessageLoggerStub(),
         this);
 }
Exemplo n.º 3
0
        public void LoadMockassembly()
        {
            // Sanity check to be sure we have the correct version of mock-assembly.dll
            Assert.That(NUnit.Tests.Assemblies.MockAssembly.Tests, Is.EqualTo(31),
                        "The reference to mock-assembly.dll appears to be the wrong version");

            // Load the NUnit mock-assembly.dll once for this test, saving
            // the list of test cases sent to the discovery sink
            nunittestDiscoverer = ((ITestDiscoverer) new NUnit3TestDiscoverer());
            nunittestDiscoverer.DiscoverTests(new[] { MockAssemblyPath }, null, this, this);
        }
        public void LoadMockassembly()
        {
            // Sanity check to be sure we have the correct version of mock-assembly.dll
            Assert.That(NUnit.Tests.Assemblies.MockAssembly.Tests, Is.EqualTo(31),
                "The reference to mock-assembly.dll appears to be the wrong version");

            // Load the NUnit mock-assembly.dll once for this test, saving
            // the list of test cases sent to the discovery sink
            nunittestDiscoverer = ((ITestDiscoverer)new NUnit3TestDiscoverer());
            nunittestDiscoverer.DiscoverTests(new[] { MockAssemblyPath}, null, this, this);
        }
Exemplo n.º 5
0
        /// <summary>
        /// This is the equivalent of "RunAll" functionality
        /// </summary>
        /// <param name="sources">Refers to the list of test sources passed to the test adapter from the client.  (Client could be VS or command line)</param>
        /// <param name="runContext">Defines the settings related to the current run</param>
        /// <param name="frameworkHandle">Handle to framework.  Used for recording results</param>
        public void RunTests(IEnumerable <string> sources, ITestDiscoverer discoverer)
        {
            ValidateArg.NotNull(sources, nameof(sources));
            ValidateArg.NotNull(discoverer, nameof(discoverer));

            var receiver = new TestReceiver();

            discoverer.DiscoverTests(sources, /*discoveryContext*/ null, this.frameworkHandle, receiver);

            if (this.cancelRequested.WaitOne(0))
            {
                return;
            }

            this.RunTests(receiver.Tests);
        }
        public void LoadMockassembly()
        {
            // Sanity check to be sure we have the correct version of mock-assembly.dll
            Assert.That(NUnit.Tests.Assemblies.MockAssembly.TestsAtRuntime, Is.EqualTo(NUnit.Tests.Assemblies.MockAssembly.Tests),
                        "The reference to mock-assembly.dll appears to be the wrong version");

            TestCases = new List <TestCase>();

            // Load the NUnit mock-assembly.dll once for this test, saving
            // the list of test cases sent to the discovery sink
            nunittestDiscoverer = ((ITestDiscoverer) new NUnit3TestDiscoverer());
            nunittestDiscoverer.DiscoverTests(
                new[] { MockAssemblyPath },
                _context,
                new MessageLoggerStub(),
                this);
        }
Exemplo n.º 7
0
 public void VerifyLoading()
 {
     // Load the NUnit empty-assembly.dll once for this test
     nunittestDiscoverer = ((ITestDiscoverer) new NUnit3TestDiscoverer());
     nunittestDiscoverer.DiscoverTests(new[] { EmptyAssemblyPath }, null, this, this);
 }
Exemplo n.º 8
0
 public void VerifyLoading()
 {
     // Load the NUnit empty-assembly.dll once for this test
     nunittestDiscoverer = ((ITestDiscoverer)new NUnit3TestDiscoverer());
     nunittestDiscoverer.DiscoverTests(
         new[] { EmptyAssemblyPath}, 
         new FakeDiscoveryContext(), 
         new MessageLoggerStub(), 
         this);
 }
 public void VerifyLoading()
 {
     // Load the NUnit empty-assembly.dll once for this test
     nunittestDiscoverer = ((ITestDiscoverer)new NUnit3TestDiscoverer());
     nunittestDiscoverer.DiscoverTests(new[] { EmptyAssemblyPath}, null, this, this);
 }