コード例 #1
0
        public void with_set_child()
        {
            theParagraph.AddChild(new Sentence {
                format = "Go left"
            });
            theParagraph.AddChild(new Sentence {
                format = "Go right"
            });

            var @set = new SetVerification
            {
                title = "Some Table",
                cells = new Cell[] { new Cell {
                                         Key = "One"
                                     }, new Cell {
                                         Key = "Two"
                                     }, new Cell {
                                         Key = "Three"
                                     }, }
            };



            theParagraph.AddChild(@set);
            var code = theParagraph.ToMissingCode();

            code.ShouldContain(@"
        [StoryTeller.Hidden]
        public StoryTeller.IGrammar TheParagraph_3()
        {
            return VerifySetOf(getTheParagraph_3Rows)");
        }
コード例 #2
0
 public void SetVerification(SetVerification verification, IStep step)
 {
     withNewLeaf(step, Icon.SetVerification, node =>
     {
         node.AddText(verification.Label);
         addRearrangeCommands(node);
     });
 }
コード例 #3
0
        void ITestStream.SetVerification(SetVerification verification, IStep step)
        {
            var container = _document.Current.JoinTagAtEnd <TableContainerTag>();

            var tag = new StoryTellerTableTag(verification, step);

            tag.WritePreview(_context);

            container.Add(verification.Label, tag);
        }
コード例 #4
0
        private IReaderMode buildSet(bool ordered)
        {
            _hasAdded = true;
            var set = new SetVerification
            {
                key     = _key,
                title   = _title,
                ordered = ordered
            };

            _adder(set);

            return(new TableMode(set));
        }
コード例 #5
0
        public void when_writing_the_grammar_structure()
        {
            SetVerificationGrammar grammar = Fixture.VerifySetOf(c => new ValidationError[0])
                                             .Titled("the title")
                                             .LeafNameIs("group1")
                                             .MatchOn(x => x.Field, x => x.Message);


            var setVerification = grammar.ToStructure(null).ShouldBeOfType <SetVerification>();
            var expected        = new SetVerification("the title", "group1", Cell.For <string>("Field"),
                                                      Cell.For <string>("Message"));

            setVerification.ShouldEqual(expected);
        }
コード例 #6
0
        protected override void theContextIs()
        {
            step = new Step().With("x", 1).With("y", 2);

            treeBuilder.StartTest(theTest);

            section = new Section("Math");

            treeBuilder.StartTest(theTest);
            treeBuilder.StartSection(section, new FixtureGraph("Math"));

            set = new SetVerification("the label of this grammar", "leaf1");

            treeBuilder.SetVerification(set, step);
        }
コード例 #7
0
        public void WriteSetVerificationResults(SetVerification verification, ITestContext context)
        {
            if (verification.Ordered)
            {
                _headerRow.InsertFirst(new HtmlTag("th").Text("Order"));
            }

            var results = context.ResultsFor(_step);

            results.ForExceptionText(writeExceptionText);

            var rows = results.GetResult <IList <SetRow> >(_table.LeafName) ?? new List <SetRow>();

            // TODO -- order this the right way

            rows.Each(x =>
            {
                writeVerificationResultRow(x, context, verification.Ordered);
            });

            _headerRow.FirstChild().AddClass("left-cell");
        }
コード例 #8
0
        public void with_set_child()
        {
            theParagraph.AddChild(new Sentence { format = "Go left" });
            theParagraph.AddChild(new Sentence { format = "Go right" });

            var @set = new SetVerification
            {
                title = "Some Table",
                cells = new Cell[] { new Cell { Key = "One" }, new Cell { Key = "Two" }, new Cell { Key = "Three" }, }
            };

            


            theParagraph.AddChild(@set);
            var code = theParagraph.ToMissingCode();

            code.ShouldContain(@"
        [StoryTeller.Hidden]
        public StoryTeller.IGrammar TheParagraph_3()
        {
            return VerifySetOf(getTheParagraph_3Rows)");
        }
コード例 #9
0
 void IGrammarVisitor.SetVerification(SetVerification setVerification, IStep step)
 {
     add(setVerification.Name, setVerification.Label, Icon.SetVerification);
 }
コード例 #10
0
ファイル: FixtureTag.cs プロジェクト: larsw/storyteller
 void IGrammarVisitor.SetVerification(SetVerification setVerification, IStep step)
 {
     writeTable(setVerification);
 }
コード例 #11
0
ファイル: UsageGraph.cs プロジェクト: larsw/storyteller
 void ITestStream.SetVerification(SetVerification verification, IStep step)
 {
     markGrammar(verification.Name);
 }
コード例 #12
0
 void IGrammarVisitor.SetVerification(SetVerification setVerification, IStep step)
 {
     _link.Label(setVerification.Label);
 }