LeafFor() public méthode

public LeafFor ( string name ) : StepLeaf
name string
Résultat StepLeaf
Exemple #1
0
 public void step_childstepsfor_is_wired_up()
 {
     var step = new Step();
     var child = new Step();
     step.LeafFor("record").Add(child);
     step.LeafFor("record").AllSteps().ShouldContain(child);
     step.LeafFor("something else").AllSteps().ShouldNotContain(child);
 }
        public void execute_runs_the_child_steps_within_the_fixture()
        {
            string sectionName = typeof(ArithmeticFixture).GetFixtureAlias();

            Step step = new Step().WithChildren(sectionName, new Step(), new Step(), new Step());

            var context = MockRepository.GenerateMock<ITestContext>();

            new EmbeddedSectionGrammar<ArithmeticFixture>().Execute(step, context);

            context.AssertWasCalled(
                x => x.ExecuteWithFixture<ArithmeticFixture>(step.LeafFor(sectionName), step));
        }
        public void SetUp()
        {
            step = new Step();
            StepLeaf leaf = step.LeafFor("record");

            leaf.Add(new Step().With("a:1,b:2"));
            leaf.Add(new Step().With("a:3,b:4"));
            leaf.Add(new Step().With("a:5,b:6"));

            inner = new RecordingGrammar();
            grammar = new TableGrammar(inner.As<IGrammarWithCells>(), "record")
                .Before(() => inner.Numbers.Add("0"))
                .After(() => inner.Numbers.Add("7"));

            grammar.LabelName = "some label";

            grammar.Execute(step);
        }
        private void addTest(string name, Action<StepLeaf> configure)
        {
            var test = new Test(name);
            var section = new Section(typeof(SampleTableFixture).GetFixtureAlias());
            test.Add(section);
            var step = new Step("Table1");
            section.Add(step);

            var leaf = step.LeafFor("rows");
            configure(leaf);

            AddTest(name, test);
        }
        public void SetUp()
        {
            step = new Step();

            step.LeafFor("record")
                .WithStep("a:1,b:2")
                .WithStep("a:3,b:4")
                .WithStep("a:5,b:6");

            inner = MockRepository.GenerateMock<LineGrammar>();
            grammar = new TableGrammar(inner, "record");

            grammar.LabelName = "some label";
        }