Exemple #1
0
        public void StartListeningTo(IReportingChannel reportingChannel)
        {
            ValidateSpecialMessageHandlersArePresent();

            _channels.Add(reportingChannel);
            reportingChannel.MessageReceived += OnMessageReceived;
        }
Exemple #2
0
        public void StartListeningTo(IReportingChannel reportingChannel)
        {
            ValidateSpecialMessageHandlersArePresent();

            _channels.Add(reportingChannel);
            reportingChannel.MessageReceived += OnMessageReceived;
        }
 public TestDiscoveryStartMessageHandler(
     ITestRunnerFactory testRunnerFactory,
     IReportingChannel adapterChannel,
     IReportingChannelFactory reportingChannelFactory)
 {
     _testRunnerFactory = testRunnerFactory;
     _adapterChannel = adapterChannel;
     _reportingChannelFactory = reportingChannelFactory;
 }
 public GetTestRunnerProcessStartInfoMessageHandler(
     ITestRunnerFactory testRunnerFactory,
     IReportingChannel adapterChannel,
     IReportingChannelFactory reportingChannelFactory)
 {
     _testRunnerFactory = testRunnerFactory;
     _adapterChannel = adapterChannel;
     _reportingChannelFactory = reportingChannelFactory;
 }
Exemple #5
0
 public TestDiscoveryStartMessageHandler(
     ITestRunnerFactory testRunnerFactory,
     IReportingChannel adapterChannel,
     IReportingChannelFactory reportingChannelFactory)
 {
     _testRunnerFactory       = testRunnerFactory;
     _adapterChannel          = adapterChannel;
     _reportingChannelFactory = reportingChannelFactory;
 }
Exemple #6
0
 protected TestRunnerResultMessageHandler(
     IReportingChannel adapterChannel,
     DotnetTestState nextStateIfHandled,
     string messageIfHandled)
 {
     _adapterChannel     = adapterChannel;
     _nextStateIfHandled = nextStateIfHandled;
     _messageIfHandled   = messageIfHandled;
 }
Exemple #7
0
 public GetTestRunnerProcessStartInfoMessageHandler(
     ITestRunnerFactory testRunnerFactory,
     IReportingChannel adapterChannel,
     IReportingChannelFactory reportingChannelFactory)
 {
     _testRunnerFactory       = testRunnerFactory;
     _adapterChannel          = adapterChannel;
     _reportingChannelFactory = reportingChannelFactory;
 }
 protected TestRunnerResultMessageHandler(
     IReportingChannel adapterChannel,
     DotnetTestState nextStateIfHandled,
     string messageIfHandled)
 {
     _adapterChannel = adapterChannel;
     _nextStateIfHandled = nextStateIfHandled;
     _messageIfHandled = messageIfHandled;
 }
        private void OnTestRunnerChannelCreated(object sender, IReportingChannel testRunnerChannel)
        {
            if (_testRunnerChannel != null)
            {
                const string errorMessage = "TestRunnerWaitingCommandMessageHandler already has a test runner channel";
                throw new InvalidOperationException(errorMessage);
            }

            _testRunnerChannel = testRunnerChannel;
        }
Exemple #10
0
        private void OnTestRunnerChannelCreated(object sender, IReportingChannel testRunnerChannel)
        {
            if (_testRunnerChannel != null)
            {
                const string errorMessage = "TestRunnerWaitingCommandMessageHandler already has a test runner channel";
                throw new InvalidOperationException(errorMessage);
            }

            _testRunnerChannel = testRunnerChannel;
        }
        public static IDotnetTest AddTestDiscoveryMessageHandlers(
            this IDotnetTest dotnetTest,
            IReportingChannel adapterChannel,
            IReportingChannelFactory reportingChannelFactory,
            ITestRunnerFactory testRunnerFactory)
        {
            dotnetTest.AddMessageHandler(
                new TestDiscoveryStartMessageHandler(testRunnerFactory, adapterChannel, reportingChannelFactory));

            return(dotnetTest);
        }
Exemple #12
0
        public static IDotnetTest AddTestRunnnersMessageHandlers(
            this IDotnetTest dotnetTest,
            IReportingChannel adapterChannel)
        {
            dotnetTest.AddMessageHandler(new TestRunnerTestStartedMessageHandler(adapterChannel));
            dotnetTest.AddMessageHandler(new TestRunnerTestResultMessageHandler(adapterChannel));
            dotnetTest.AddMessageHandler(new TestRunnerTestFoundMessageHandler(adapterChannel));
            dotnetTest.AddMessageHandler(new TestRunnerTestCompletedMessageHandler(adapterChannel));

            return dotnetTest;
        }
Exemple #13
0
        public static IDotnetTest AddTestDiscoveryMessageHandlers(
            this IDotnetTest dotnetTest,
            IReportingChannel adapterChannel,
            IReportingChannelFactory reportingChannelFactory,
            ITestRunnerFactory testRunnerFactory)
        {
            dotnetTest.AddMessageHandler(
                new TestDiscoveryStartMessageHandler(testRunnerFactory, adapterChannel, reportingChannelFactory));

            return dotnetTest;
        }
        public static IDotnetTest AddNonSpecificMessageHandlers(
            this IDotnetTest dotnetTest,
            ITestMessagesCollection messages,
            IReportingChannel adapterChannel)
        {
            dotnetTest.TestSessionTerminateMessageHandler = new TestSessionTerminateMessageHandler(messages);
            dotnetTest.UnknownMessageHandler = new UnknownMessageHandler(adapterChannel);

            dotnetTest.AddMessageHandler(new VersionCheckMessageHandler(adapterChannel));

            return(dotnetTest);
        }
Exemple #15
0
        public static IDotnetTest AddNonSpecificMessageHandlers(
            this IDotnetTest dotnetTest,
            ITestMessagesCollection messages,
            IReportingChannel adapterChannel)
        {
            dotnetTest.TestSessionTerminateMessageHandler = new TestSessionTerminateMessageHandler(messages);
            dotnetTest.UnknownMessageHandler = new UnknownMessageHandler(adapterChannel);

            dotnetTest.AddMessageHandler(new VersionCheckMessageHandler(adapterChannel));

            return dotnetTest;
        }
        public static IDotnetTest AddTestRunMessageHandlers(
            this IDotnetTest dotnetTest,
            IReportingChannel adapterChannel,
            IReportingChannelFactory reportingChannelFactory,
            ITestRunnerFactory testRunnerFactory)
        {
            dotnetTest.AddMessageHandler(new GetTestRunnerProcessStartInfoMessageHandler(
                                             testRunnerFactory,
                                             adapterChannel,
                                             reportingChannelFactory));

            return(dotnetTest);
        }
        public static IDotnetTest AddTestRunnnersMessageHandlers(
            this IDotnetTest dotnetTest,
            IReportingChannel adapterChannel,
            IReportingChannelFactory reportingChannelFactory)
        {
            dotnetTest.AddMessageHandler(new TestRunnerTestStartedMessageHandler(adapterChannel));
            dotnetTest.AddMessageHandler(new TestRunnerTestResultMessageHandler(adapterChannel));
            dotnetTest.AddMessageHandler(new TestRunnerTestFoundMessageHandler(adapterChannel));
            dotnetTest.AddMessageHandler(new TestRunnerTestCompletedMessageHandler(adapterChannel));
            dotnetTest.AddMessageHandler(new TestRunnerWaitingCommandMessageHandler(reportingChannelFactory));

            return(dotnetTest);
        }
Exemple #18
0
        public static IDotnetTest AddTestRunMessageHandlers(
            this IDotnetTest dotnetTest,
            IReportingChannel adapterChannel,
            IReportingChannelFactory reportingChannelFactory,
            ITestRunnerFactory testRunnerFactory)
        {
            dotnetTest.AddMessageHandler(new GetTestRunnerProcessStartInfoMessageHandler(
                testRunnerFactory,
                adapterChannel,
                reportingChannelFactory));

            return dotnetTest;
        }
Exemple #19
0
 public TestRunnerTestCompletedMessageHandler(IReportingChannel adapterChannel)
 {
     _adapterChannel = adapterChannel;
 }
 public VersionCheckMessageHandler(IReportingChannel adapterChannel)
 {
     _adapterChannel = adapterChannel;
 }
 public UnknownMessageHandler(IReportingChannel adapterChannel)
 {
     _adapterChannel = adapterChannel;
 }
 public TestRunnerTestCompletedMessageHandler(IReportingChannel adapterChannel)
 {
     _adapterChannel = adapterChannel;
 }
 public TestRunnerTestStartedMessageHandler(IReportingChannel adapterChannel)
     : base(adapterChannel, DotnetTestState.TestExecutionStarted, TestMessageTypes.TestExecutionStarted)
 {
 }
 public TestRunnerTestFoundMessageHandler(IReportingChannel adapterChannel)
     : base(adapterChannel, DotnetTestState.TestDiscoveryStarted, TestMessageTypes.TestDiscoveryTestFound)
 {
 }
 public TestRunnerTestResultMessageHandler(IReportingChannel adapterChannel)
     : base(adapterChannel, DotnetTestState.TestExecutionStarted, TestMessageTypes.TestExecutionTestResult)
 {
 }
 public TestRunnerTestFoundMessageHandler(IReportingChannel adapterChannel)
     : base(adapterChannel, DotnetTestState.TestDiscoveryStarted, TestMessageTypes.TestDiscoveryTestFound)
 {
 }
 public VersionCheckMessageHandler(IReportingChannel adapterChannel)
 {
     _adapterChannel = adapterChannel;
 }