public void SetValue(ExecutionContext context, string value)
        {
            if (_scenario != null)
            {
                if (_scenario.GetInitializationState() == ScenarioInitializationValue.NotInitialized)
                {
                    _scenario.FullInitialize().Wait();
                }
                else
                {
                    while (_scenario.GetInitializationState() == ScenarioInitializationValue.Initializing)
                    {
                        SystemUtils.Sleep(100, context.CancellationTokenSource);
                    }
                }

                var executionId = string.Empty;
                if (Mode == RunExistingScenarioMode.Asynchronously)
                {
                    _scenario?.ExecuteAsyncParallel(ScenarioActionSource, value, context);
                }
                else if (Mode == RunExistingScenarioMode.Synchronously)
                {
                    _scenario?.Execute(ScenarioActionSource, value, out executionId, context);
                }
                else if (Mode == RunExistingScenarioMode.MainExecutionContext)
                {
                    _scenario?.ExecuteAsync(ScenarioActionSource, value, out executionId, context);
                }
            }
        }
Esempio n. 2
0
 private static void Main(string[] args)
 {
     Scenario.Execute();
 }
Esempio n. 3
0
 private async Task ProcessItem(ScenarioBase scenario)
 {
     await scenario.Execute();
 }