public void ShouldFindScopedHook_WithScopeAttribute()
        {
            var builder = new RuntimeBindingRegistryBuilder(bindingSourceProcessorStub, new SpecFlowAttributesFilter());

            builder.BuildBindingsFromAssembly(Assembly.GetExecutingAssembly());

            Assert.Equal(1,
                         bindingSourceProcessorStub.HookBindings.Count(s => s.Method.Name == "Tag1BeforeScenario" && s.IsScoped));
        }
Beispiel #2
0
        public void ShouldFindScopedHook_WithMultipleCtorArg()
        {
            var builder = new RuntimeBindingRegistryBuilder(bindingSourceProcessorStub);

            builder.BuildBindingsFromAssembly(Assembly.GetExecutingAssembly());

            Assert.Equal(2,
                         bindingSourceProcessorStub.HookBindings.Count(s => s.Method.Name == "Tag34BeforeScenario" && s.IsScoped));
        }
        public void ShouldFindExampleConverter()
        {
            var builder = new RuntimeBindingRegistryBuilder(bindingSourceProcessorStub);

            builder.BuildBindingsFromAssembly(Assembly.GetExecutingAssembly());
            Assert.AreEqual(1,
                            bindingSourceProcessorStub.StepArgumentTransformationBindings.Count(
                                s =>
                                s.Regex != null && s.Regex.Match("BindingRegistryTests").Success&&
                                s.Regex.Match("").Success == false));
        }
        public void ShouldFindScopedExampleConverter()
        {
            var builder = new RuntimeBindingRegistryBuilder(bindingSourceProcessorStub);

            builder.BuildBindingsFromAssembly(Assembly.GetExecutingAssembly());

            Assert.AreEqual(2,
                            bindingSourceProcessorStub.StepDefinitionBindings.Count(
                                s =>
                                s.StepDefinitionType == StepDefinitionType.Then &&
                                s.Regex.Match("SpecificBindingRegistryTests").Success&& s.IsScoped));
            Assert.AreEqual(0,
                            bindingSourceProcessorStub.StepDefinitionBindings.Count(
                                s =>
                                s.StepDefinitionType == StepDefinitionType.Then &&
                                s.Regex.Match("SpecificBindingRegistryTests").Success&& s.IsScoped == false));
        }