public void Should_not_pass_decorated_feature_tag_as_test_class_category()
        {
            var decoratorMock = DecoratorRegistryTests.CreateTestClassTagDecoratorMock("decorated");

            container.RegisterInstanceAs(decoratorMock.Object, "decorated");

            var generator = CreateUnitTestFeatureGenerator();

            var theFeature = ParserHelper.CreateDocument(new string[] { "decorated", "other" });

            GenerateFeature(generator, theFeature);

            unitTestGeneratorProviderMock.Verify(ug => ug.SetTestClassCategories(It.IsAny <TestClassGenerationContext>(), It.Is <IEnumerable <string> >(cats => !cats.Contains("decorated"))));
        }
Example #2
0
        public void Should_not_pass_decorated_scenario_tag_as_test_method_category()
        {
            var decoratorMock = DecoratorRegistryTests.CreateTestMethodTagDecoratorMock("decorated");

            container.RegisterInstanceAs(decoratorMock.Object, "decorated");

            var generator = CreateUnitTestFeatureGenerator();

            Feature theFeature = CreateFeature();

            theFeature.Scenarios[0].Tags = new Tags(new Tag("decorated"), new Tag("other"));

            GenerateFeature(generator, theFeature);

            unitTestGeneratorProviderMock.Verify(ug => ug.SetTestMethodCategories(It.IsAny <TestClassGenerationContext>(), It.IsAny <CodeMemberMethod>(), It.Is <IEnumerable <string> >(cats => !cats.Contains("decorated"))));
        }