private void Then_the_contact_book_should_contains_all_other_contacts(ScenarioContext ctx)
 {
     Assert.That(
         ctx.AddedContacts.Except(ctx.RemovedContacts).ToArray(),
         Is.EquivalentTo(ctx.ContactBook.Contacts.ToArray()),
         "All contacts that has not been explicitly removed should be still present in contact book");
 }
 private void Then_all_contacts_should_be_available_in_the_contact_book(ScenarioContext ctx)
 {
     Assert.That(
         ctx.ContactBook.Contacts.ToArray(),
         Is.EquivalentTo(ctx.AddedContacts),
         "Contacts should be added to contact book");
 }
 private void Then_all_contacts_should_be_available_in_the_contact_book(ScenarioContext ctx)
 {
     CollectionAssert.AreEquivalent(
         ctx.AddedContacts,
         ctx.ContactBook.Contacts.ToArray(),
         "Contacts should be added to contact book");
 }
 private void Then_the_contact_book_should_not_contain_removed_contact_any_more(ScenarioContext ctx)
 {
     Assert.AreEqual(
         Enumerable.Empty<Contact>(),
         ctx.ContactBook.Contacts.Where(c => ctx.RemovedContacts.Contains(c)).ToArray(),
         "Contact book should not contain removed books");
 }
 private void Then_all_contacts_should_be_available_in_the_contact_book(ScenarioContext ctx)
 {
     Assert.AreElementsEqualIgnoringOrder(
         ctx.AddedContacts,
         ctx.ContactBook.Contacts.ToArray(),
         "Contacts should be added to contact book");
 }
        public void Setup()
        {
            skeletonProviders = new Dictionary<ProgrammingLanguage, IStepDefinitionSkeletonProvider>();
            skeletonProviders.Add(ProgrammingLanguage.CSharp, new Mock<IStepDefinitionSkeletonProvider>().Object);

            var culture = new CultureInfo("en-US");
            contextManagerStub = new Mock<IContextManager>();
            scenarioContext = new ScenarioContext(new ScenarioInfo("scenario_title"), null, null);
            contextManagerStub.Setup(cm => cm.ScenarioContext).Returns(scenarioContext);
            contextManagerStub.Setup(cm => cm.FeatureContext).Returns(new FeatureContext(new FeatureInfo(culture, "feature_title", "", ProgrammingLanguage.CSharp), culture));

            runtimeBindingRegistryBuilderStub = new Mock<IRuntimeBindingRegistryBuilder>();

            bindingRegistryStub = new Mock<IBindingRegistry>();
            bindingRegistryStub.Setup(br => br.GetHooks(HookType.BeforeStep)).Returns(beforeStepEvents);
            bindingRegistryStub.Setup(br => br.GetHooks(HookType.AfterStep)).Returns(afterStepEvents);
            bindingRegistryStub.Setup(br => br.GetHooks(HookType.BeforeScenarioBlock)).Returns(beforeScenarioBlockEvents);
            bindingRegistryStub.Setup(br => br.GetHooks(HookType.AfterScenarioBlock)).Returns(afterScenarioBlockEvents);

            runtimeConfiguration = new RuntimeConfiguration();
            errorProviderStub = new Mock<IErrorProvider>();
            testTracerStub = new Mock<ITestTracer>();
            stepDefinitionMatcherStub = new Mock<IStepDefinitionMatchService>();
            methodBindingInvokerMock = new Mock<IBindingInvoker>();

            stepErrorHandlers = new Dictionary<string, IStepErrorHandler>();
        }
 private void Then_the_contact_book_should_contains_all_other_contacts(ScenarioContext ctx)
 {
     Assert.AreElementsEqualIgnoringOrder(
         ctx.ContactBook.Contacts.ToArray(),
         ctx.AddedContacts.Except(ctx.RemovedContacts).ToArray(),
         "All contacts that has not been explicitly removed should be still present in contact book");
 }
Exemplo n.º 8
0
 public void Initialize()
 {
     featureContext = new FeatureContext(null);
     scenarioContext = new ScenarioContext(featureContext, null);
     stepContext = new StepContext(featureContext, scenarioContext);
     sut = new ContextHandler(featureContext, scenarioContext, stepContext);
 }
        public void SetUp()
        {
            // ScenarioContext is needed, because the [Binding]-instances live there
            var scenarioContext = new ScenarioContext(null,new ObjectContainer());
            contextManagerStub.Setup(cm => cm.ScenarioContext).Returns(scenarioContext);

            bindingRegistryStub.Setup(br => br.GetStepTransformations()).Returns(stepTransformations);
        }
Exemplo n.º 10
0
        public Result Initialize(RunDescriptor run, EndpointBehaviour endpointBehaviour, IDictionary<Type, string> routingTable, string endpointName)
        {
            try
            {
                behaviour = endpointBehaviour;
                scenarioContext = run.ScenarioContext;
                configuration = ((IEndpointConfigurationFactory)Activator.CreateInstance(endpointBehaviour.EndpointBuilderType)).Get();
                configuration.EndpointName = endpointName;

                if (!string.IsNullOrEmpty(configuration.CustomMachineName))
                {
                    NServiceBus.Support.RuntimeEnvironment.MachineNameAction = () => configuration.CustomMachineName;
                }

                //apply custom config settings
                endpointBehaviour.CustomConfig.ForEach(customAction => customAction(config));
                config = configuration.GetConfiguration(run, routingTable);

                if (scenarioContext != null)
                {
                    config.Configurer.RegisterSingleton(scenarioContext.GetType(), scenarioContext);
                    scenarioContext.ContextPropertyChanged += scenarioContext_ContextPropertyChanged;
                }

                bus = config.CreateBus();

                Configure.Instance.ForInstallationOn<Windows>().Install();

                Task.Factory.StartNew(() =>
                    {
                        while (!stopped)
                        {
                            contextChanged.WaitOne(TimeSpan.FromSeconds(5)); //we spin around each 5 s since the callback mechanism seems to be shaky

                            lock (behaviour)
                            {

                                foreach (var when in behaviour.Whens)
                                {
                                    if (executedWhens.Contains(when.Id))
                                        continue;

                                    if(when.ExecuteAction(scenarioContext, bus))
                                        executedWhens.Add(when.Id);
                                }
                            }
                        }
                    });

                return Result.Success();
            }
            catch (Exception ex)
            {
                Logger.Error("Failed to initalize endpoint " + endpointName, ex);
                return Result.Failure(ex);
            }
        }
Exemplo n.º 11
0
        public void SetUp()
        {
            // ScenarioContext is needed, because the [Binding]-instances live there
            var scenarioContext = new ScenarioContext(null, null, null);
            contextManagerStub.Setup(cm => cm.ScenarioContext).Returns(scenarioContext);

            List<StepTransformationBinding> stepTransformations = new List<StepTransformationBinding>();
            bindingRegistryStub.Setup(br => br.StepTransformations).Returns(stepTransformations);
        }
Exemplo n.º 12
0
 void RegisterInheritanceHierarchyOfContextInSettings(ScenarioContext context)
 {
     var type = context.GetType();
     while (type != typeof(object))
     {
         endpointConfiguration.GetSettings().Set(type.FullName, scenarioContext);
         type = type.BaseType;
     }
 }
        private void AddSomeContacts(ScenarioContext ctx)
        {
            ctx.AddedContacts = new[]
            {
                new Contact("Jack", "123-456-789"),
                new Contact("Samantha", "321-654-987"),
                new Contact("Josh", "132-465-798")
            };

            foreach (var contact in ctx.AddedContacts)
                ctx.ContactBook.AddContact(contact.Name, contact.PhoneNumber);
        }
Exemplo n.º 14
0
        void ProcessStep(Step step, Criterion criterion, ScenarioContext scenarioContext,
            IExecutionContextFactory executionContextFactory)
        {
            dynamic executionContext = executionContextFactory.Create(scenarioContext.Scenario, step);

            _progressReporter.Report(new StepStartedReport(scenarioContext.Scenario.ScenarioId, criterion.CriterionId,
                step.StepId, executionContext.ExecutionContextId));

            StepExecutionResult result = executionContext.Execute(step as dynamic, scenarioContext);

            _progressReporter.Report(new StepStoppedReport(scenarioContext.Scenario.ScenarioId, criterion.CriterionId,
                step.StepId, executionContext.ExecutionContextId, result));
        }
Exemplo n.º 15
0
        public void Run(Criterion criterion, ScenarioContext scenarioContext,
            IExecutionContextFactory executionContextFactory)
        {
            _progressReporter.Report(new CriterionStartedReport(scenarioContext.Scenario.ScenarioId,
                criterion.CriterionId));

            foreach (Step step in criterion.Steps)
            {
                ProcessStep(step, criterion, scenarioContext, executionContextFactory);
            }

            _progressReporter.Report(new CriterionStoppedReport(scenarioContext.Scenario.ScenarioId,
                criterion.CriterionId));
        }
Exemplo n.º 16
0
        public async Task Initialize(RunDescriptor run, EndpointBehavior endpointBehavior,
            IDictionary<Type, string> routingTable, string endpointName)
        {
            try
            {
                behavior = endpointBehavior;
                scenarioContext = run.ScenarioContext;
                runSettings = run.Settings;
                var endpointConfigurationFactory = (IEndpointConfigurationFactory)Activator.CreateInstance(endpointBehavior.EndpointBuilderType);
                endpointConfigurationFactory.ScenarioContext = run.ScenarioContext;
                configuration = endpointConfigurationFactory.Get();
                configuration.EndpointName = endpointName;

                if (!string.IsNullOrEmpty(configuration.CustomMachineName))
                {
                    RuntimeEnvironment.MachineNameAction = () => configuration.CustomMachineName;
                }

                //apply custom config settings
                if (configuration.GetConfiguration == null)
                {
                    throw new Exception($"Missing EndpointSetup<T> in the constructor of {endpointName} endpoint.");
                }
                endpointConfiguration = await configuration.GetConfiguration(run, routingTable).ConfigureAwait(false);
                RegisterInheritanceHierarchyOfContextInSettings(scenarioContext);

                endpointBehavior.CustomConfig.ForEach(customAction => customAction(endpointConfiguration, scenarioContext));

                if (configuration.SendOnly)
                {
                    endpointConfiguration.SendOnly();
                }

                startable = await Endpoint.Create(endpointConfiguration).ConfigureAwait(false);

                if (!configuration.SendOnly)
                {
                    var transportInfrastructure = endpointConfiguration.GetSettings().Get<TransportInfrastructure>();
                    scenarioContext.HasNativePubSubSupport = transportInfrastructure.OutboundRoutingPolicy.Publishes == OutboundRoutingType.Multicast;
                }
            }
            catch (Exception ex)
            {
                Logger.Error("Failed to initialize endpoint " + endpointName, ex);
                throw;
            }
        }
 private void Given_my_contact_book_is_filled_with_many_contacts(ScenarioContext ctx)
 {
     for (int i = 0; i < 10000; ++i)
         ctx.ContactBook.AddContact(i.ToString(CultureInfo.InvariantCulture), i.ToString(CultureInfo.InvariantCulture));
 }
 private void When_I_remove_one_contact(ScenarioContext ctx)
 {
     ctx.RemovedContacts = ctx.ContactBook.Contacts.Take(1).ToArray();
     foreach (var contact in ctx.RemovedContacts)
         ctx.ContactBook.Remove(contact.Name);
 }
Exemplo n.º 19
0
 public NewTextPageSteps(ScenarioContext injectedContext)
 {
     _context = injectedContext;
 }
 private void Given_my_contact_book_is_empty(ScenarioContext ctx)
 {
     ctx.ContactBook = new ContactBook();
 }
 public IResult <TestResult> BuildAmbiguousResult(ulong durationInNanoseconds, ScenarioContext scenarioContext)
 {
     return(BuildTestResult(durationInNanoseconds, Status.Ambiguous, _testAmbiguousMessageFactory.BuildFromScenarioContext(scenarioContext)));
 }
Exemplo n.º 22
0
 public ContextAppender(ScenarioContext context, EndpointConfiguration endpointConfiguration)
 {
     this.context = context;
     this.endpointConfiguration = endpointConfiguration;
 }
 public ContextAppender(ScenarioContext context)
 {
     this.context = context;
 }
Exemplo n.º 24
0
        public TestExecutionEngineTests()
        {
            specFlowConfiguration = ConfigurationLoader.GetDefault();

            testThreadContainer = new ObjectContainer();
            featureContainer    = new ObjectContainer();
            scenarioContainer   = new ObjectContainer();

            beforeScenarioEvents      = new List <IHookBinding>();
            afterScenarioEvents       = new List <IHookBinding>();
            beforeStepEvents          = new List <IHookBinding>();
            afterStepEvents           = new List <IHookBinding>();
            beforeFeatureEvents       = new List <IHookBinding>();
            afterFeatureEvents        = new List <IHookBinding>();
            beforeTestRunEvents       = new List <IHookBinding>();
            afterTestRunEvents        = new List <IHookBinding>();
            beforeScenarioBlockEvents = new List <IHookBinding>();
            afterScenarioBlockEvents  = new List <IHookBinding>();

            stepDefinitionSkeletonProviderMock = new Mock <IStepDefinitionSkeletonProvider>();
            testObjectResolverMock             = new Mock <ITestObjectResolver>();
            testObjectResolverMock.Setup(bir => bir.ResolveBindingInstance(It.IsAny <Type>(), It.IsAny <IObjectContainer>()))
            .Returns((Type t, IObjectContainer container) => defaultTestObjectResolver.ResolveBindingInstance(t, container));

            var culture = new CultureInfo("en-US");

            contextManagerStub = new Mock <IContextManager>();
            scenarioInfo       = new ScenarioInfo("scenario_title", "scenario_description");
            scenarioContext    = new ScenarioContext(scenarioContainer, scenarioInfo, testObjectResolverMock.Object);
            scenarioContainer.RegisterInstanceAs(scenarioContext);
            contextManagerStub.Setup(cm => cm.ScenarioContext).Returns(scenarioContext);
            featureInfo = new FeatureInfo(culture, "feature_title", "", ProgrammingLanguage.CSharp);
            var featureContext = new FeatureContext(featureContainer, featureInfo, specFlowConfiguration);

            featureContainer.RegisterInstanceAs(featureContext);
            contextManagerStub.Setup(cm => cm.FeatureContext).Returns(featureContext);
            contextManagerStub.Setup(cm => cm.StepContext).Returns(new ScenarioStepContext(new StepInfo(StepDefinitionType.Given, "step_title", null, null)));

            bindingRegistryStub = new Mock <IBindingRegistry>();
            bindingRegistryStub.Setup(br => br.GetHooks(HookType.BeforeStep)).Returns(beforeStepEvents);
            bindingRegistryStub.Setup(br => br.GetHooks(HookType.AfterStep)).Returns(afterStepEvents);
            bindingRegistryStub.Setup(br => br.GetHooks(HookType.BeforeScenarioBlock)).Returns(beforeScenarioBlockEvents);
            bindingRegistryStub.Setup(br => br.GetHooks(HookType.AfterScenarioBlock)).Returns(afterScenarioBlockEvents);
            bindingRegistryStub.Setup(br => br.GetHooks(HookType.BeforeFeature)).Returns(beforeFeatureEvents);
            bindingRegistryStub.Setup(br => br.GetHooks(HookType.AfterFeature)).Returns(afterFeatureEvents);
            bindingRegistryStub.Setup(br => br.GetHooks(HookType.BeforeTestRun)).Returns(beforeTestRunEvents);
            bindingRegistryStub.Setup(br => br.GetHooks(HookType.AfterTestRun)).Returns(afterTestRunEvents);
            bindingRegistryStub.Setup(br => br.GetHooks(HookType.BeforeScenario)).Returns(beforeScenarioEvents);
            bindingRegistryStub.Setup(br => br.GetHooks(HookType.AfterScenario)).Returns(afterScenarioEvents);

            specFlowConfiguration     = ConfigurationLoader.GetDefault();
            errorProviderStub         = new Mock <IErrorProvider>();
            testTracerStub            = new Mock <ITestTracer>();
            stepDefinitionMatcherStub = new Mock <IStepDefinitionMatchService>();
            methodBindingInvokerMock  = new Mock <IBindingInvoker>();

            stepErrorHandlers       = new Dictionary <string, IStepErrorHandler>();
            obsoleteTestHandlerMock = new Mock <IObsoleteStepHandler>();

            cucumberMessageSenderMock = new Mock <ICucumberMessageSender>();
            cucumberMessageSenderMock.Setup(m => m.SendTestRunStarted())
            .Callback(() => { });

            _testPendingMessageFactory   = new TestPendingMessageFactory(errorProviderStub.Object);
            _testUndefinedMessageFactory = new TestUndefinedMessageFactory(stepDefinitionSkeletonProviderMock.Object, errorProviderStub.Object, specFlowConfiguration);

            _analyticsEventProvider = new Mock <IAnalyticsEventProvider>();
            _analyticsTransmitter   = new Mock <IAnalyticsTransmitter>();
            _analyticsTransmitter.Setup(at => at.TransmitSpecFlowProjectRunningEvent(It.IsAny <SpecFlowProjectRunningEvent>()))
            .Callback(() => { });

            _testRunnerManager = new Mock <ITestRunnerManager>();
            _testRunnerManager.Setup(trm => trm.TestAssembly).Returns(Assembly.GetCallingAssembly);
        }
 public CommonPageStepDefinition(IWebDriver driver, ScenarioContext scenarioContext) : base(driver)
 {
     _scenarioContext = scenarioContext;
     InitializePageObjects();
 }
Exemplo n.º 26
0
 public AceitarPedidoDeMatchSteps(ScenarioContext scenarioContext)
 {
     this._scenarioContext       = scenarioContext;
     this._urlAceitarPedidoMatch = "https://localhost:5003/api/v1/PedidoMatch/aceitar/?";
 }
Exemplo n.º 27
0
 public TestLoggingAdapter(ScenarioContext scenarioContext)
 {
     this.scenarioContext = scenarioContext;
 }
 public ContentStateBindings(FeatureContext featureContext, ScenarioContext scenarioContext)
 {
     this.scenarioContext = scenarioContext;
     this.featureContext  = featureContext;
 }
Exemplo n.º 29
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BaseTestSteps" /> class.
 /// </summary>
 /// <param name="context">The scenario context.</param>
 protected BaseTestSteps(ScenarioContext context) : base(context)
 {
 }
Exemplo n.º 30
0
 public LogonPageSteps(ScenarioContext scenarioContext) : base(scenarioContext)
 {
 }
Exemplo n.º 31
0
 public Setup(FeatureInfo featureInfo, ScenarioInfo scenarioInfo, ScenarioContext scenarioContext)
 {
     _featureInfo     = featureInfo;
     _scenarioInfo    = scenarioInfo;
     _scenarioContext = scenarioContext;
 }
 public static string GetNextPictureName(FeatureContext featureContext, ScenarioContext scenarioContext)
 {
     return(GetNextSupportingInfoFileName(featureContext, scenarioContext, EmuShotPrefix, "png"));
 }
 public FileControlSteps(ScenarioContext injectedContext)
     : base(injectedContext)
 {
 }
        public static string GetNextSupportingInfoFileName(FeatureContext featureContext, ScenarioContext scenarioContext,
                                                           string prefix, string extension)
        {
            Assert.NotNull(featureContext);
            Assert.NotNull(scenarioContext);

            lock (featureContext)
                lock (scenarioContext)
                {
                    object objectPictureIndex;
                    if (!scenarioContext.TryGetValue(EmuPictureIndexKey, out objectPictureIndex))
                    {
                        objectPictureIndex = 0;
                    }
                    var pictureIndex = (int)objectPictureIndex;
                    scenarioContext[EmuPictureIndexKey] = ++pictureIndex;

                    var fileName = String.Format("{0}{1}_{2}_{3}.{4}",
                                                 prefix,
                                                 featureContext.FeatureInfo.Title,
                                                 scenarioContext.ScenarioInfo.Title,
                                                 pictureIndex,
                                                 extension);

                    foreach (var ch in Path.GetInvalidFileNameChars())
                    {
                        fileName = fileName.Replace(ch, '_');
                    }

                    return(fileName);
                }
        }
Exemplo n.º 35
0
 protected override void SetupContextTags()
 {
     var f = new FeatureContext(null, new[] { "tag1" });
     Tiny.TinyIoCContainer.Current.Register(f);
     var c = new ScenarioContext(f, null, new[] { "tag2", "tag5" });
     Tiny.TinyIoCContainer.Current.Register(c);
 }
 public ERSchemaRefreshManagement(ITestConfiguration testConfiguration, ScenarioContext scenarioContext)
 {
     this.scenarioContext = scenarioContext ?? throw new ArgumentNullException("ScenarioContext is null");
     _testCfg             = testConfiguration ?? throw new Exception("Something went wrong with Test Setup. The setup provides a parallel safe version of test configuration settings.");
     refreshSchemaList    = new List <RestClientResponse <PlatformItemResponse> >();
 }
Exemplo n.º 37
0
 public ObservableExTimerSteps(ScenarioContext scenarioContext)
 {
     _scenario = scenarioContext;
 }
Exemplo n.º 38
0
 public UsuarioSteps(ScenarioContext scenarioContext, UsuarioService usuarioService)
 {
     _scenarioContext = scenarioContext;
     _usuarioService  = usuarioService;
 }
 private void When_I_add_new_contacts(ScenarioContext ctx)
 {
     AddSomeContacts(ctx);
 }
Exemplo n.º 40
0
        /// <summary>
        /// This is the method that gets called when the job starts running
        /// </summary>
        /// <returns></returns>
        public async Task RunAsync()
        {
            var server             = _config.ServiceUrl;
            var microsoftAuthority = _config.MicrosoftAuthority;
            var dataHubIdentifier  = _config.DataHubIdentifier;

            if (string.IsNullOrWhiteSpace(server))
            {
                string errorMessage = "Server URL is not available.";
                _logger.LogError(_scenario.Description, "JobRunner ScenarioTester", new Dictionary <string, string>()
                {
                    { "scenario.errorMessage", errorMessage }
                });

                throw new InvalidOperationException(errorMessage);
            }

            using (var context = new ScenarioContext())
            {
                context[Context.ServiceUrl]    = server;
                context[Context.ApplicationId] = KeyVault.GetSecretFromKeyvault(_config.ServiceKeyVaultName, _config.ApplicationId);

                // The flow config needs to be saved at this location
                string blobUri = $"{_config.BlobUri}";
                context[Context.FlowConfigContent] = await Task.Run(() => BlobUtility.GetBlobContent(KeyVault.GetSecretFromKeyvault(_config.BlobConnectionString), blobUri));

                context[Context.DataHubIdentifier]  = dataHubIdentifier;
                context[Context.SecretKey]          = KeyVault.GetSecretFromKeyvault(_config.ServiceKeyVaultName, _config.SecretKey);
                context[Context.MicrosoftAuthority] = microsoftAuthority;
                using (_logger.BeginScope <IReadOnlyCollection <KeyValuePair <string, object> > >(
                           new Dictionary <string, object> {
                    { "scenario.Description", _scenario.Description },
                    { "scenarioCount", _scenarioCount.ToString() },
                    { "scenario.Steps", $"[{string.Join(", ", _scenario.Steps.Select(s => s.Method.Name))}]" }
                }))
                {
                    // do actual logging inside the scope. All logs inside this will have the properties from the Dictionary used in begin scope.
                    _logger.LogInformation("JobRunner ScenarioTester: " + _scenario.Description);
                }

                var results = await ScenarioResult.RunAsync(_scenario, context, _scenarioCount);

                int iterationCount = 0;

                foreach (var result in results)
                {
                    string scenarioResult = result.Failed ? "failed" : "succeeded";

                    // log failed steps.
                    foreach (var stepResult in result.StepResults.Where(r => !r.Success))
                    {
                        using (_logger.BeginScope <IReadOnlyCollection <KeyValuePair <string, object> > >(
                                   new Dictionary <string, object> {
                            { "Scenario iteration", $"Scenario iteration {_scenario.Description}.{iterationCount} " },
                            { "ScenarioResult length", scenarioResult.Length }
                        }))
                        {
                            // do actual logging inside the scope. All logs inside this will have the properties from the Dictionary used in begin scope.
                            _logger.LogInformation(_scenario.Description);
                        }

                        if (stepResult.Exception != null)
                        {
                            _logger.LogError(stepResult.Exception, _scenario.Description);
                        }
                        _logger.LogError(stepResult.Value);
                    }

                    iterationCount++;
                }

                //emit metric on how many parallel executions passed.
                using (_logger.BeginScope <IReadOnlyCollection <KeyValuePair <string, object> > >(
                           new Dictionary <string, object> {
                    { "SuccessRate", $"{(long)((double)results.Count(r => !r.Failed) / _scenarioCount * 100.0)}" }
                }))
                {
                    // do actual logging inside the scope. All logs inside this will have the properties from the Dictionary used in begin scope.
                    _logger.LogInformation(_scenario.Description);
                }
            }
        }
 private void Given_my_contact_book_is_filled_with_contacts(ScenarioContext ctx)
 {
     ctx.ContactBook = new ContactBook();
     AddSomeContacts(ctx);
 }
Exemplo n.º 42
0
 public TestIndependenceMutator(ScenarioContext scenarioContext)
 {
     testRunId = scenarioContext.TestRunId.ToString();
 }
 public IResult <TestResult> BuildFailedResult(ulong durationInNanoseconds, ScenarioContext scenarioContext)
 {
     return(BuildTestResult(durationInNanoseconds, Status.Failed, _testErrorMessageFactory.BuildFromScenarioContext(scenarioContext)));
 }
Exemplo n.º 44
0
 public UnregisteredVP(ScenarioContext scenarioContext)
 {
     _scenarioContext = scenarioContext;
 }
Exemplo n.º 45
0
 public Authorization(UITest test, ScenarioContext context)
     : base(test, context)
 {
 }
Exemplo n.º 46
0
 public SampleTestingStepDefs(ScenarioContext injectedContext)
 {
     context = injectedContext;
 }
 private void When_I_clear_it(ScenarioContext ctx)
 {
     foreach (var contact in ctx.ContactBook.Contacts.ToArray())
         ctx.ContactBook.Remove(contact.Name);
     StepExecution.Bypass("Contact book clearing is not implemented yet. Contacts are removed one by one.");
 }
 public IResult <TestResult> BuildUndefinedResult(ulong durationInNanoseconds, ScenarioContext scenarioContext, FeatureContext featureContext)
 {
     return(BuildTestResult(durationInNanoseconds, Status.Undefined, _testUndefinedMessageFactory.BuildFromContext(scenarioContext, featureContext)));
 }
Exemplo n.º 49
0
 public void ScenarioContextInjection(ScenarioContext scenarioContextInject)
 {
     scenarioContext = scenarioContextInject;
 }
 public IResult <TestResult> BuildPendingResult(ulong durationInNanoseconds, ScenarioContext scenarioContext)
 {
     return(BuildTestResult(durationInNanoseconds, Status.Pending, _testPendingMessageFactory.BuildFromScenarioContext(scenarioContext)));
 }
 public TestItemStartedEventArgs(IClientService service, StartTestItemRequest request, ITestReporter testReporter, FeatureContext featureContext, ScenarioContext scenarioContext)
     : this(service, request, testReporter)
 {
     this.FeatureContext  = featureContext;
     this.ScenarioContext = scenarioContext;
 }
 private void Then_all_contacts_should_be_available_in_the_contact_book(ScenarioContext ctx)
 {
     Assert.Equal(
         ctx.AddedContacts,
         ctx.ContactBook.Contacts.ToArray());
 }
Exemplo n.º 53
0
 public TestIndependenceSkipBehavior(ScenarioContext scenarioContext)
 {
     testRunId = scenarioContext.TestRunId.ToString();
 }
 private void Then_the_contact_book_should_contains_all_other_contacts(ScenarioContext ctx)
 {
     Assert.Equal(
         ctx.ContactBook.Contacts.ToArray(),
         ctx.AddedContacts.Except(ctx.RemovedContacts).ToArray());
 }
Exemplo n.º 55
0
 protected override void SetupContextTags()
 {
     var f = new FeatureContext(null, new string[0]);
     Tiny.TinyIoCContainer.Current.Register(f);
     var c = new ScenarioContext(f, null, new[] { "DontRun" });
     Tiny.TinyIoCContainer.Current.Register(c);
 }
 private void Then_the_contact_book_should_be_empty(ScenarioContext ctx)
 {
     Assert.IsEmpty(ctx.ContactBook.Contacts, "Contact book should be empty");
 }
 public CalculatorStepDefinitions(ScenarioContext scenarioContext)
 {
     _scenarioContext = scenarioContext;
 }
 public LaunchApplication(DefaultContext dc, FeatureContext fc, ScenarioContext sc)
 {
     this.defaultcontext  = dc;
     this.featurecontext  = fc;
     this.scenariocontext = sc;
 }
Exemplo n.º 59
0
 public ContextHandler(FeatureContext featureContext, ScenarioContext scenarioContext, StepContext stepContext)
 {
     this.featureContext = featureContext;
     this.scenarioContext = scenarioContext;
     this.stepContext = stepContext;
 }
 public _2694_HasLearnerAchievedMinimumStandardForEnglishMathsPageSteps(ScenarioContext scenarioContext)
 {
     _scenarioContext = scenarioContext;
 }