Ejemplo n.º 1
0
        public void If_assettion_happens_before_begin_test_event_arrives_should_match()
        {
            var testExecutionMethodBeginClientEvent = new TestExecutionMethodBeginClientEvent
            {
                NamespaceName = "a",
                ClassName     = "b",
                MethodName    = "c",
            };
            var dialogAssertionServerEvent = new DialogAssertionServerEvent(DialogType.Assert)
            {
                Message = "at b.c",
            };
            var dialogAssertionMatchmaker = new DialogAssertionMatchmaker();
            var testExecutionMethod       = new TestExecutionMethodPassedClientEvent
            {
                NamespaceName = "a",
                ClassName     = "b",
                MethodName    = "c",
            };
            bool match = false;


            dialogAssertionMatchmaker.AddAssertionHandler(dialogAssertionServerEvent, item =>
            {
                match = true;
            });
            dialogAssertionMatchmaker.HandleMethodBeginClientEvent(testExecutionMethodBeginClientEvent);


            dialogAssertionMatchmaker.WasEventAlreadyClosed(testExecutionMethod).ShouldBeTrue();
            match.ShouldBeTrue();
        }
Ejemplo n.º 2
0
 public void Handle(DialogAssertionServerEvent message)
 {
     if (message == null)
     {
         throw new ArgumentNullException("message");
     }
     WriteString(message.Message);
 }
        public void Handle(DialogAssertionServerEvent message)
        {
            if (message == null)
            {
                throw new ArgumentNullException("message");
            }
            string writeMessage = message.Message;

            WriteServerEventFailure("DialogAssertionServerEvent", writeMessage);
        }
        public void AddAssertionHandler(DialogAssertionServerEvent message, Action <TestExecutionMethodBeginClientEvent> onMatched)
        {
            var item = _notHandledYet.FirstOrDefault(begin => message.Message.Contains(GetItemToSearchFor(begin)));

            if (item == null)
            {
                _dialogAssertionEventsWithHandlers.Add(message, onMatched);
            }
            else
            {
                _notHandledYet.Remove(item);
                MarkItMatched(item, onMatched);
            }
        }
Ejemplo n.º 5
0
        public void Handle(DialogAssertionServerEvent message)
        {
            Action <TestExecutionMethodBeginClientEvent> handler = m =>
            {
                var namespaceName = m.NamespaceName;
                var className     = m.ClassName;
                var methodName    = m.MethodName;

                var msg = new TestCaseResultServerEvent(ResultType.Failed)
                {
                    OtherInfo     = message.Message,
                    NamespaceName = namespaceName,
                    ClassName     = className,
                    MethodName    = methodName,
                };

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

                ReportIt(msg);
            };

            if (message.DialogType == DialogType.Assert)
            {
                _dialogAssertionMessageMatchmaker.AddAssertionHandler(message, handler);
            }
            else if (message.DialogType == DialogType.MessageBox)
            {
                var msg = new TestCaseResultServerEvent(ResultType.SystemGeneratedFailure)
                {
                    OtherInfo     = message.Message,
                    NamespaceName = "[StatLight]",
                    ClassName     = "[CannotFigureItOut]",
                    MethodName    = "[NotEnoughContext]",
                };

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

                ReportIt(msg);
            }
        }
Ejemplo n.º 6
0
 public void Handle(DialogAssertionServerEvent message)
 {
     ResetTimer();
 }
 public void AddAssertionHandler(DialogAssertionServerEvent message, Action <TestExecutionMethodBeginClientEvent> onMatched)
 {
     _dialogAssertionEventsWithHandlers.Add(message, onMatched);
 }
 public void Handle(DialogAssertionServerEvent message)
 {
     if (message == null) throw new ArgumentNullException("message");
     string writeMessage = message.Message;
     WriteServerEventFailure("DialogAssertionServerEvent", writeMessage);
 }