Example #1
0
        public void AppendDependenciesToXml(
            XmlNode featureNode,
            SpecificationGroup specification)
        {
            var parent = featureNode.ParentNode;

            var featurePath = specification.Feature.File;

            if (!this.HasTests(featurePath))
            {
                var dependencyNode = this.NewDependencyNode(featurePath, DependencyTestsFileExtension);
                parent.InsertAfter(dependencyNode, featureNode);
            }

            if (!this.HasTestCheckers(featurePath))
            {
                var dependencyNode = this.NewDependencyNode(featurePath, DependencyStepCheckersFileExtension);
                parent.InsertAfter(dependencyNode, featureNode);
            }

            foreach (var stepsBuilder in specification.Steps)
            {
                var scenarioName = stepsBuilder.Scenario.Name;
                if (!this.HasSteps(featurePath, scenarioName))
                {
                    var dependencyNode = this.NewDependencyNode(featurePath, MakeStepsFileExtension(scenarioName));
                    parent.InsertAfter(dependencyNode, featureNode);
                }
            }
        }
Example #2
0
        private IEnumerable<SpecificationGroup> GenerateGroups()
        {
            var groups = new List<SpecificationGroup>();

            var features = this.Features;

            this.ReportFeaturesFound(features);

            foreach (var feature in features)
            {
                var spec = new SpecificationGroup(feature)
                {
                    @Tests = this.MakeTestsBuilder(feature),
                    @TestCheckers = this.MakeTestCheckersBuilder(feature),
                    @StepBuilderGenerator = (Scenario s) =>
                        {
                            return this.MakeStepsBuilder(
                                feature,
                                s);
                        }
                };

                foreach (var scenario in feature.Scenarios)
                {
                    spec.AddStepBuilder(scenario);
                }

                groups.Add(spec);
            }

            return groups;
        }