public void BeginScope(ILogScope logScope)
        {
            var communicationMessage = new BeginScopeCommunicationMessage
            {
                Id            = logScope.Id,
                ParentScopeId = logScope.Parent?.Id,
                Name          = logScope.Name,
                BeginTime     = logScope.BeginTime
            };

            Console.WriteLine(ModelSerializer.Serialize <BeginScopeCommunicationMessage>(communicationMessage));
        }
Beispiel #2
0
        private void CommandsSource_OnBeginLogScopeCommand(Shared.Execution.ILogContext logContext, Shared.Extensibility.Commands.CommandArgs.LogScopeCommandArgs args)
        {
            var logScope = args.LogScope;

            if (_outputHelperMap.TryGetValue(Context.Current.Log.Root, out ITestOutputHelper output))
            {
                var communicationMessage = new BeginScopeCommunicationMessage
                {
                    Id            = logScope.Id,
                    ParentScopeId = logScope.Parent?.Id,
                    Name          = logScope.Name,
                    BeginTime     = logScope.BeginTime
                };

                NotifyAgent(output, Client.Converters.ModelSerializer.Serialize <BeginScopeCommunicationMessage>(communicationMessage));
            }
        }
Beispiel #3
0
        private void HandleBeginScopeCommunicationAction(ITestReporter testReporter, BeginScopeCommunicationMessage logScopeMessage)
        {
            var startNestedStepRequest = new StartTestItemRequest
            {
                Name      = logScopeMessage.Name,
                StartTime = logScopeMessage.BeginTime,
                Type      = TestItemType.Step,
                HasStats  = false
            };

            if (logScopeMessage.ParentScopeId != null)
            {
                testReporter = _nestedScopes[logScopeMessage.ParentScopeId];
            }

            var nestedStep = testReporter.StartChildTestReporter(startNestedStepRequest);

            _nestedScopes[logScopeMessage.Id] = nestedStep;
        }
Beispiel #4
0
        private bool HandleBeginLogScopeCommunicationAction(ITestReporter testReporter, BeginScopeCommunicationMessage message)
        {
            var startTestItemRequest = new StartTestItemRequest
            {
                Name      = message.Name,
                StartTime = message.BeginTime,
                Type      = TestItemType.Step,
                HasStats  = false
            };

            if (message.ParentScopeId != null)
            {
                testReporter = _nestedSteps[message.ParentScopeId];
            }

            var nestedStep = testReporter.StartChildTestReporter(startTestItemRequest);

            _nestedSteps[message.Id] = nestedStep;

            return(true);
        }