internal void FillExecutionResults(ExecutionResultViewModel executionResult) { if (executionResult.IsSuccess) { LastExecutedStatus = ExecutionStatus.Success; LastExecutionTime = executionResult.ExecutionTime; } else { LastExecutedStatus = ExecutionStatus.Fail; LastExecutionTime = executionResult.ExecutionTime; LastExecutionStackTrace = executionResult.StackTrace; } }
private void Execute(int scenarioId) { var scenario = _scenarioRepository.GetEntirely(scenarioId); var executor = GetExecutorInstance(); ExecutionResultViewModel executionResult; var stopwatch = Stopwatch.StartNew(); try { executor.Execute(scenario); executionResult = new ExecutionResultViewModel { ScenarioId = scenarioId, IsSuccess = true, ExecutionTime = GetEllapsedTime(stopwatch) }; } catch (Exception exception) { executionResult = new ExecutionResultViewModel { ScenarioId = scenarioId, IsSuccess = false, ExecutionTime = GetEllapsedTime(stopwatch), Message = exception.Message, StackTrace = exception.StackTrace }; } if (_executionResults.ContainsKey(scenarioId)) { _executionResults[scenarioId] = executionResult; } else { _executionResults.Add(scenarioId, executionResult); } }