Exemplo n.º 1
0
        private void ProcessQueue(TestEventsCollector collector)
        {
            if (!collector.DelayedEvents.Any())
            {
                return;
            }

            foreach (var myEvent in collector.DelayedEvents)
            {
                switch (myEvent.myType)
                {
                case EventType.RunFinished:
                    RunFinished(myUnitTestLaunch);
                    break;

                case EventType.TestFinished:
                    TestFinished(myUnitTestLaunch, GetTestResult(myEvent.Event));
                    break;

                case EventType.TestStarted:
                    var tResult = new TestResult(myEvent.Event.myID, myEvent.Event.myAssemblyName, string.Empty, 0, Status.Running, myEvent.Event.myParentID);
                    TestStarted(myUnitTestLaunch, tResult);
                    break;
                }
            }

            collector.Clear();
        }
Exemplo n.º 2
0
        internal TestEventsSender(TestEventsCollector collector, UnitTestLaunch unitTestLaunch)
        {
            myUnitTestLaunch = unitTestLaunch;
            ProcessQueue(collector);
            collector.Clear();

            collector.ClearEvent();
            collector.AddEvent += (col, _) =>
            {
                ProcessQueue((TestEventsCollector)col);
            };
        }