/// <inheritdoc/>
        public bool OnMessageWithTypes(IMessageSinkMessage message, HashSet <string> messageTypes)
        {
            var result = executionSink.OnMessageWithTypes(message, messageTypes);

            result = innerSink.OnMessageWithTypes(message, messageTypes) && result;
            return(result);
        }
示例#2
0
    public bool OnMessageWithTypes(IMessageSinkMessage message, HashSet <string> messageTypes)
    {
        var result = _innerSink.OnMessageWithTypes(message, messageTypes);

        message.Dispatch <ITestAssemblyFinished>(messageTypes, args => _completionCallback(ExecutionSummary));
        return(result);
    }
示例#3
0
        /// <inheritdoc/>
        public override bool OnMessageWithTypes(IMessageSinkMessage message, string[] messageTypes)
        {
            var hashedTypes = GetMessageTypesAsHashSet(messageTypes);

            var testSkipped = Cast <ITestSkipped>(message, hashedTypes);

            if (testSkipped != null)
            {
                SkipCount++;
                var testFailed = new TestFailed(testSkipped.Test, 0M, "",
                                                new[] { "FAIL_SKIP" },
                                                new[] { testSkipped.Reason },
                                                new[] { "" },
                                                new[] { -1 });
                return(Sink.OnMessageWithTypes(testFailed, TestFailedTypes));
            }

            var testCollectionFinished = Cast <ITestCollectionFinished>(message, hashedTypes);

            if (testCollectionFinished != null)
            {
                testCollectionFinished = new TestCollectionFinished(testCollectionFinished.TestCases,
                                                                    testCollectionFinished.TestCollection,
                                                                    testCollectionFinished.ExecutionTime,
                                                                    testCollectionFinished.TestsRun,
                                                                    testCollectionFinished.TestsFailed + testCollectionFinished.TestsSkipped,
                                                                    0);
                return(Sink.OnMessageWithTypes(testCollectionFinished, TestCollectionFinishedTypes));
            }

            var assemblyFinished = Cast <ITestAssemblyFinished>(message, hashedTypes);

            if (assemblyFinished != null)
            {
                assemblyFinished = new TestAssemblyFinished(assemblyFinished.TestCases,
                                                            assemblyFinished.TestAssembly,
                                                            assemblyFinished.ExecutionTime,
                                                            assemblyFinished.TestsRun,
                                                            assemblyFinished.TestsFailed + assemblyFinished.TestsSkipped,
                                                            0);
                return(Sink.OnMessageWithTypes(assemblyFinished, TestAssemblyFinishedTypes));
            }

            return(Sink.OnMessageWithTypes(message, messageTypes));
        }
示例#4
0
        /// <inheritdoc/>
        public bool OnMessageWithTypes(IMessageSinkMessage message, HashSet <string> messageTypes)
        {
            var testSkipped = message.Cast <ITestSkipped>(messageTypes);

            if (testSkipped != null)
            {
                skipCount++;
                var testFailed = new TestFailed(testSkipped.Test, 0M, "",
                                                new[] { "FAIL_SKIP" },
                                                new[] { testSkipped.Reason },
                                                new[] { "" },
                                                new[] { -1 });
                return(innerSink.OnMessage(testFailed));
            }

            var testCollectionFinished = message.Cast <ITestCollectionFinished>(messageTypes);

            if (testCollectionFinished != null)
            {
                testCollectionFinished = new TestCollectionFinished(testCollectionFinished.TestCases,
                                                                    testCollectionFinished.TestCollection,
                                                                    testCollectionFinished.ExecutionTime,
                                                                    testCollectionFinished.TestsRun,
                                                                    testCollectionFinished.TestsFailed + testCollectionFinished.TestsSkipped,
                                                                    0);
                return(innerSink.OnMessage(testCollectionFinished));
            }

            var assemblyFinished = message.Cast <ITestAssemblyFinished>(messageTypes);

            if (assemblyFinished != null)
            {
                assemblyFinished = new TestAssemblyFinished(assemblyFinished.TestCases,
                                                            assemblyFinished.TestAssembly,
                                                            assemblyFinished.ExecutionTime,
                                                            assemblyFinished.TestsRun,
                                                            assemblyFinished.TestsFailed + assemblyFinished.TestsSkipped,
                                                            0);
                return(innerSink.OnMessage(assemblyFinished));
            }

            return(innerSink.OnMessageWithTypes(message, messageTypes));
        }
        /// <inheritdoc/>
        public bool OnMessageWithTypes(IMessageSinkMessage message, HashSet <string> messageTypes)
        {
            // Call the inner sink first, because we want to be able to depend on ExecutionSummary
            // being correctly filled out.
            var result = innerSink.OnMessageWithTypes(message, messageTypes);

            return(message.Dispatch <IErrorMessage>(messageTypes, HandleErrorMessage) &&
                   message.Dispatch <ITestAssemblyCleanupFailure>(messageTypes, HandleTestAssemblyCleanupFailure) &&
                   message.Dispatch <ITestAssemblyFinished>(messageTypes, HandleTestAssemblyFinished) &&
                   message.Dispatch <ITestAssemblyStarting>(messageTypes, HandleTestAssemblyStarting) &&
                   message.Dispatch <ITestCaseCleanupFailure>(messageTypes, HandleTestCaseCleanupFailure) &&
                   message.Dispatch <ITestClassCleanupFailure>(messageTypes, HandleTestClassCleanupFailure) &&
                   message.Dispatch <ITestCleanupFailure>(messageTypes, HandleTestCleanupFailure) &&
                   message.Dispatch <ITestCollectionCleanupFailure>(messageTypes, HandleTestCollectionCleanupFailure) &&
                   message.Dispatch <ITestCollectionFinished>(messageTypes, HandleTestCollectionFinished) &&
                   message.Dispatch <ITestFailed>(messageTypes, HandleTestFailed) &&
                   message.Dispatch <ITestMethodCleanupFailure>(messageTypes, HandleTestMethodCleanupFailure) &&
                   message.Dispatch <ITestPassed>(messageTypes, HandleTestPassed) &&
                   message.Dispatch <ITestSkipped>(messageTypes, HandleTestSkipped) &&
                   result);
        }