Inheritance: StoryTeller.Model.GrammarStructure
コード例 #1
0
        public void create_example_test()
        {
            var test = new Test("some test");
            test.Section("a");
            test.Section("b");
            test.Section("c");
            Section section = new Section("Math").WithStep("MultiplyBy").WithStep("step1").WithStep("step2");
            test.Add(section);

            var structure = new StubGrammarStructure
            {
                Name = "MultiplyBy",
                Parent = new FixtureGraph("Math")
            };
            structure.ModifyExampleTest(test);

            test.Parts.Count.ShouldEqual(1);
            var theSection = test.Parts[0].ShouldBeOfType<Section>();

            theSection.Parts.Count.ShouldEqual(1);
            theSection.Parts[0].ShouldBeOfType<IStep>().GrammarKey.ShouldEqual("MultiplyBy");
        }
コード例 #2
0
 public void get_path_with_parent()
 {
     var structure = new StubGrammarStructure
     {
         Name = "grammar1",
         Parent = new FixtureGraph("fixture1")
     };
     structure.GetPath().Locator.ShouldEqual("fixture1/grammar1");
 }
コード例 #3
0
 public void get_path_without_parent()
 {
     var structure = new StubGrammarStructure
     {
         Name = "grammar1"
     };
     structure.GetPath().Locator.ShouldEqual("grammar1");
 }
コード例 #4
0
        public void SetUp()
        {
            graph = new FixtureGraph("something");
            structure = new StubGrammarStructure();

            graph.AddStructure("grammar1", structure);
        }
コード例 #5
0
        public void SetUp()
        {
            var library = new FixtureLibrary();

            var grammar1 = MockRepository.GenerateMock<IGrammar>();
            var grammar2 = MockRepository.GenerateMock<IGrammar>();
            var grammar3 = MockRepository.GenerateMock<IGrammar>();

            structure1 = new StubGrammarStructure();
            structure2 = new StubGrammarStructure();
            structure3 = new StubGrammarStructure();

            grammar1.Expect(x => x.Description).Return("something");
            grammar1.Expect(x => x.ToStructure(library)).Return(structure1);
            grammar2.Expect(x => x.ToStructure(library)).Return(structure2);
            grammar3.Expect(x => x.ToStructure(library)).Return(structure3);

            grammar = new ParagraphGrammar("the title").With(grammar1, grammar2, grammar3);
            grammar.Style = EmbedStyle.TitledAndIndented;
            theStructure = grammar.ToStructure(library).ShouldBeOfType<Paragraph>();
        }
コード例 #6
0
        public void SetUp()
        {
            fixtureStructure = new FixtureStructure("something");
            structure = new StubGrammarStructure();

            fixtureStructure.AddStructure("grammar1", structure);
        }