Пример #1
0
 private void handle(LiveTestStatusMessage liveTestStatusMessage)
 {
     _syncContext.Post(x =>
     {
         lock (_messagLock)
         {
             Handle((LiveTestStatusMessage)x);
             label1.Refresh();
         }
     }, liveTestStatusMessage);
 }
Пример #2
0
        private new void Handle(LiveTestStatusMessage liveStatus)
        {
            if (!_isRunning)
                return;

            listViewFeedback.SuspendLayout();
            var ofCount = liveStatus.TotalNumberOfTests > 0 ? string.Format(" of {0}", liveStatus.TotalNumberOfTests) : "";
            var testName = liveStatus.CurrentTest;
            if (testName.Trim().Length > 0)
                testName += " in ";
            printMessage(new RunMessages(RunMessageType.Normal, string.Format("testing {3}{0} ({1}{2} tests completed)", Path.GetFileNameWithoutExtension(liveStatus.CurrentAssembly), liveStatus.TestsCompleted, ofCount, testName)));

            if (_showFailing)
            {
                foreach (var test in liveStatus.FailedButNowPassingTests)
                {
                    var testItem = new CacheTestMessage(test.Assembly, test.Test);
                    foreach (ListViewItem item in listViewFeedback.Items)
                    {
                        if (item.Tag.GetType() != typeof(CacheTestMessage))
                            continue;
                        var itm = (CacheTestMessage)item.Tag;
                        if (isTheSameTestAs(itm, testItem))
                        {
                            item.Remove();
                            break;
                        }
                    }
                }

                object selected = null;
                if (listViewFeedback.SelectedItems.Count == 1)
                    selected = listViewFeedback.SelectedItems[0].Tag;
                foreach (var test in liveStatus.FailedTests)
                {
                    var testItem = new CacheTestMessage(test.Assembly, test.Test);
                    ListViewItem toRemove = null;
                    foreach (ListViewItem item in listViewFeedback.Items)
                    {
                        if (item.Tag.GetType() != typeof(CacheTestMessage))
                            continue;
                        var itm = (CacheTestMessage)item.Tag;
                        if (isTheSameTestAs(itm, testItem))
                        {
                            toRemove = item;
                            break;
                        }
                    }
                    int index = toRemove == null ? 0 : toRemove.Index;
                    if (toRemove != null)
                        toRemove.Remove();
                    addFeedbackItem("Test failed", formatTestResult(testItem), Color.Red, testItem, selected, index);
                }
            }
            listViewFeedback.ResumeLayout();
        }
Пример #3
0
 public LiveTestFeedbackArgs(LiveTestStatusMessage message)
 {
     Message = message;
 }
 public void Should_subscribe_to_live_test_feedback_messages()
 {
     var message = new LiveTestStatusMessage("", 0, 0, new LiveTestStatus[] { }, new LiveTestStatus[] { });
     _bus.Publish(message);
     waitForAsyncCall(() => { return _view.LiveTestStatusMessage != null; });
     _view.LiveTestStatusMessage.ShouldBeTheSameAs(message);
 }
        public void RecievingLiveTestStatusMessage(LiveTestStatusMessage message)
        {

        }
        private new void Handle(LiveTestStatusMessage liveStatus)
        {
            if (!_isRunning)
                return;

            _storeSelected();

            var ofCount = liveStatus.TotalNumberOfTests > 0 ? string.Format(" of {0}", liveStatus.TotalNumberOfTests) : "";
            var testName = liveStatus.CurrentTest;
            if (testName.Trim().Length > 0)
                testName += " in ";
            printMessage(new RunMessages(RunMessageType.Normal, string.Format("testing {3}{0} ({1}{2} tests completed)", Path.GetFileNameWithoutExtension(liveStatus.CurrentAssembly), liveStatus.TestsCompleted, ofCount, testName)));

            if (_showFailing)
            {
                foreach (var test in liveStatus.FailedButNowPassingTests)
                {
                    var testItem = new CacheTestMessage(test.Assembly, test.Test);
                    _removeTest((t) => isTheSameTestAs(testItem, t));
                }

                foreach (var test in liveStatus.FailedTests)
                {
                    var testItem = new CacheTestMessage(test.Assembly, test.Test);
                    _removeTest((t) => isTheSameTestAs(testItem, t));
                    addFeedbackItem("Test failed", formatTestResult(testItem), Color.Red, testItem);
                }
            }

            _restoreSelected(isSame);
        }
 private void handle(LiveTestStatusMessage liveTestStatusMessage)
 {
     Handle(liveTestStatusMessage);
 }