コード例 #1
0
        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));
        }
コード例 #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));
        }
コード例 #3
0
        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));
        }
コード例 #4
0
        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));
        }