Пример #1
0
            public virtual async Task <StateMonad> GetStateMonad(
                MockRepository mockRepository,
                ILogger logger)
            {
                var externalContext = ExternalContextSetupHelper.GetExternalContext(mockRepository);

                var tStepAssembly = Assembly.GetAssembly(typeof(TStep)) !;

                var sfs = StepFactoryStoreToUse.Unwrap(
                    StepFactoryStore.Create(Settings, tStepAssembly)
                    );

                var stateMonad = new StateMonad(
                    logger,
                    Settings,
                    sfs,
                    externalContext,
                    new Dictionary <string, object>()
                    );

                foreach (var action in InitialStateActions)
                {
                    await action(stateMonad);
                }

                return(stateMonad);
            }
Пример #2
0
            /// <inheritdoc />
            public override async Task <IStep> GetStepAsync(ITestOutputHelper testOutputHelper)
            {
                await Task.CompletedTask;

                var tStepAssembly = Assembly.GetAssembly(typeof(TStep)) !;

                var sfs = StepFactoryStoreToUse.Unwrap(
                    StepFactoryStore.Create(Settings, tStepAssembly)
                    );

                testOutputHelper.WriteLine(SCL);

                var deserializeResult = SCLParsing.TryParseStep(SCL);

                deserializeResult.ShouldBeSuccessful();

                var freezeResult = deserializeResult.Value.TryFreeze(TypeReference.Any.Instance, sfs);

                freezeResult.ShouldBeSuccessful();

                return(freezeResult.Value);
            }