コード例 #1
0
        public void LoadMockassembly()
        {
            // Sanity check to be sure we have the correct version of mock-assembly.dll
            Assert.That(MockAssembly.Tests, Is.EqualTo(31),
                        "The reference to mock-assembly.dll appears to be the wrong version");
            new List <TestCase>();
            testResults = new List <TestResult>();
            testLog     = new FakeFrameworkHandle();

            // Load the NUnit mock-assembly.dll once for this test, saving
            // the list of test cases sent to the discovery sink
            executor = ((ITestExecutor) new NUnitTestExecutor());
            executor.RunTests(new[] { MockAssemblyPath }, Context, testLog);
            this.Summary = new ResultSummary(testResults);
        }
コード例 #2
0
        public void LoadMockAssembly()
        {
            _mockAssemblyPath   = Path.Combine(TestContext.CurrentContext.TestDirectory, "mock-assembly.dll");
            _mockAssemblyFolder = Path.GetDirectoryName(_mockAssemblyPath);
            // Sanity check to be sure we have the correct version of mock-assembly.dll
            Assert.That(MockAssembly.TestsAtRuntime, Is.EqualTo(MockAssembly.Tests),
                        "The reference to mock-assembly.dll appears to be the wrong version");
            testLog = new FakeFrameworkHandle();

            // Load the NUnit mock-assembly.dll once for this test, saving
            // the list of test cases sent to the discovery sink

            var testResults = testLog.Events
                              .Where(e => e.EventType == FakeFrameworkHandle.EventType.RecordResult)
                              .Select(e => e.TestResult)
                              .ToList();

            Summary = new ResultSummary(testResults);
        }