Exemple #1
0
        public void Handle(TestExecutionMethodFailedClientEvent message)
        {
            if (message == null)
            {
                throw new ArgumentNullException("message");
            }
            //_logger.Debug("Handle - TestExecutionMethodFailedClientEvent - {0}".FormatWith(message.FullMethodName));
            Action action = () =>
            {
                if (_dialogAssertionMessageMatchmaker.WasEventAlreadyClosed(message))
                {
                    // Don't include this as a "passed" test as we had to automatically close the dialog);)
                    return;
                }

                var msg = new TestCaseResultServerEvent(ResultType.Failed)
                {
                    Finished      = message.Finished,
                    Started       = message.Started,
                    ExceptionInfo = message.ExceptionInfo,
                    OtherInfo     = message.Description,
                };

                if (_currentReport != null)
                {
                    msg.XapFilePath = _currentReport.XapPath;
                }

                TranslateCoreInfo(ref msg, message);

                ReportIt(msg);
            };

            _eventMatchMacker.AddEvent(message, action);
        }
        private static void SendTestFailureClientEvent(MethodInfo method, string message)
        {
            var failureEvent = new TestExecutionMethodFailedClientEvent
            {
                ExceptionInfo = new Exception(message),
                Started       = new DateTime(),
                Finished      = new DateTime(),
            };

            PopulateCoreInfo(failureEvent, method);

            Server.PostMessage(failureEvent);
        }
Exemple #3
0
            protected override void Before_all_tests()
            {
                base.Before_all_tests();

                _testExecutionMethodFailedClientEvent = new TestExecutionMethodFailedClientEvent()
                {
                    ClassName     = "Class name test",
                    MethodName    = "method name test",
                    NamespaceName = "namespace test",
                    Finished      = new DateTime(2009, 1, 1, 1, 1, 1),
                    Started       = new DateTime(2009, 1, 1, 1, 1, 2),
                    ExceptionInfo = new Exception("Hello world"),
                };
            }
        public ClientEvent Translate(LogMessage message)
        {
            var scenarioResult = (ScenarioResult)message.Decorators[UnitTestLogDecorator.ScenarioResult];
            var testMethod     = (ITestMethod)message.Decorators[UnitTestLogDecorator.TestMethodMetadata];
            var clientEventX   = new TestExecutionMethodFailedClientEvent
            {
                ExceptionInfo = new ExceptionInfo(new Exception("An expected exception was not thrown.")),
                Finished      = scenarioResult.Finished,
                Started       = scenarioResult.Started,
            };

            clientEventX.AssignMetadata(testMethod.Method);
            clientEventX.AssignTestExecutionMethodInfo(testMethod);

            return(clientEventX);
        }
Exemple #5
0
        public ClientEvent Translate(LogMessage message)
        {
            var scenarioResult = (ScenarioResult)message.Decorators[UnitTestLogDecorator.ScenarioResult];
            var exception      = scenarioResult.Exception;
            var testMethod     = (ITestMethod)message.Decorators[UnitTestLogDecorator.TestMethodMetadata];
            var clientEventX   = new TestExecutionMethodFailedClientEvent
            {
                ExceptionInfo = exception,
                Finished      = scenarioResult.Finished,
                Started       = scenarioResult.Started,
                Description   = GetDescriptionInfo(testMethod.Method)
            };

            clientEventX.AssignTestExecutionMethodInfo(testMethod);

            return(clientEventX);
        }
            protected override void Before_all_tests()
            {
                base.Before_all_tests();

                _testExecutionMethodFailedClientEvent = new TestExecutionMethodFailedClientEvent()
                {
                    ClassName = "Class name test",
                    MethodName = "method name test",
                    NamespaceName = "namespace test",
                    Finished = new DateTime(2009, 1, 1, 1, 1, 1),
                    Started = new DateTime(2009, 1, 1, 1, 1, 2),
                    ExceptionInfo = new Exception("Hello world"),
                };
            }