public JavaScriptTestFile SelectorTester()
        {
            var mathTest = new Test("math");

            mathTest.Add(new Section("Math"));

            return(new JavaScriptTestFile("Selector Tester")
                   .TestFile("SelectorTester.js")
                   .AddTest("math", mathTest)
                   .Html(x =>
            {
                FixtureLibrary library =
                    FixtureLibrary.For(o => o.AddFixturesFromAssemblyContaining <SentenceFixture>());
                x.Add("div").Append(new TestEditorTag(library));

                x.Add("Div").AddClass(GrammarConstants.EMBEDDED).Id("section1").Add("div").AddClass(
                    GrammarConstants.STEP_HOLDER).AddClass(GrammarConstants.SECTION);
                x.Add("Div").AddClass(GrammarConstants.EMBEDDED).Id("section2").Add("div").AddClass(
                    GrammarConstants.STEP_HOLDER).AddClass(GrammarConstants.SECTION);
                x.Add("Div").AddClass(GrammarConstants.EMBEDDED).Id("section3").Add("div").AddClass(
                    GrammarConstants.STEP_HOLDER).AddClass(GrammarConstants.SECTION);
                x.Add("Div").AddClass(GrammarConstants.EMBEDDED).Id("section4").Add("div").AddClass(
                    GrammarConstants.STEP_HOLDER).AddClass(GrammarConstants.SECTION);
                x.Add("Div").AddClass(GrammarConstants.EMBEDDED).Id("section5").Add("div").AddClass(
                    GrammarConstants.STEP_HOLDER).AddClass(GrammarConstants.SECTION);
                x.Add("Div").AddClass(GrammarConstants.EMBEDDED).Id("section6").Add("div").AddClass(
                    GrammarConstants.STEP_HOLDER).AddClass(GrammarConstants.SECTION);
                x.Add("Div").AddClass(GrammarConstants.EMBEDDED).Id("section7").Add("div").AddClass(
                    GrammarConstants.STEP_HOLDER).AddClass(GrammarConstants.SECTION);
                x.Add("Div").AddClass(GrammarConstants.EMBEDDED).Id("section8").Add("div").AddClass(
                    GrammarConstants.STEP_HOLDER).AddClass(GrammarConstants.SECTION);
            })
                   .Fixtures(x => x.AddFixturesFromAssemblyContaining <SentenceFixture>()));
        }
        public TableEditorTester()
            : base("Table Editor Tester")
        {
            Fixtures(x => x.AddFixturesFromThisAssembly());
            TestFile("TableEditorTester.js");

            var library = FixtureLibrary.For(x => x.AddFixture <SampleTableFixture>());

            Add(new TestEditorTag(library).Id("testEditor1"));
            Add(new TestEditorTag(library).Id("testEditor2"));
            Add(new TestEditorTag(library).Id("testEditor3"));
            Add(new TestEditorTag(library).Id("testEditor4"));
            Add(new TestEditorTag(library).Id("testEditor5"));
            Add(new TestEditorTag(library).Id("testEditor6"));
            Add(new TestEditorTag(library).Id("testEditor7"));

            addTest("blank", leaf => { });

            addTest("test1", leaf =>
            {
                leaf.AddNewStep("a:1, b:2");
                leaf.AddNewStep("a:1, b:2");
                leaf.AddNewStep("a:1, b:2");
                leaf.AddNewStep("a:1, b:2, e:5");
            });

            addTest("data", leaf =>
            {
                leaf.AddNewStep("a:1, b:2, c:3");
            });

            Table table = (Table)library.FixtureFor("SampleTable").GrammarFor("Table1");

            Add(new TableTemplateTag(table, new CellBuilderLibrary()).Id("templateTable"));
        }
Esempio n. 3
0
        public void SetUp()
        {
            var library = FixtureLibrary.For(x => x.AddFixture <RecordingFixture>());

            system = new RecordingSystem();


            var fixtureContainerSource = new FixtureContainerSource(new Container(x =>
            {
                x.For <IFixture>().Add <RecordingFixture>().Named("Recording");
            }));

            fixtureContainerSource.RegisterFixture("Recording", typeof(RecordingFixture));

            lifecycle = new SystemLifecycle(system);
            runner    = new TestRunner(lifecycle, library, fixtureContainerSource);
            lifecycle.StartApplication();

            lifecycle.RecycleEnvironment();

            var test = new Test("something");

            test.Add(new Section("Recording").WithStep("Execute"));

            runner.RunTest(new TestExecutionRequest()
            {
                Test             = test,
                TimeoutInSeconds = 1200
            });

            system.Messages.Each(x => Debug.WriteLine(x));
        }
Esempio n. 4
0
        protected override void addChildren(string title)
        {
            var select = Add("h2").Text("Test:  ").Add <SelectTag>();

            select.Id("testName");


            Project project = StoryTeller.Testing.DataMother.GrammarProject();

            AddTest("Blank", new Test("Blank"));
            select.Option("Blank", "Blank");

            project.LoadTests().GetAllTests().Each(test =>
            {
                string testName = test.Name.Replace(" ", "_");

                select.Option(test.Name, testName);

                AddTest(testName, test);
            });

            Add("hr");

            FixtureLibrary library = FixtureLibrary.For(x => x.AddFixturesFromAssemblyContaining <SentenceFixture>());

            Add("div").Append(new TestEditorTag(library));
        }
        public void TESTNAME()
        {
            var writer =
                new GrammarWriter(FixtureLibrary.For(x => x.AddFixture <SentenceFixture>()));

            Debug.WriteLine(writer.Build().ToString());
        }
        public JavaScriptTestFile TestEditor()
        {
            JavaScriptTestFile file = new JavaScriptTestFile("Test Editor Tester").TestFile("TestEditorTester.js")
                                      .Fixtures(x => x.AddFixturesFromAssemblyContaining <SentenceFixture>());

            var testEditor =
                new TestEditorTag(FixtureLibrary.For(x => x.AddFixturesFromAssemblyContaining <SentenceFixture>()));

            file.Html(x => x.Add("div").Append(testEditor));

            Project project = StoryTeller.Testing.DataMother.GrammarProject();

            project.LoadTests().GetAllTests().Each(test =>
            {
                string testName = test.Name.Replace(" ", "_");

                Debug.WriteLine(testName);

                file.AddTest(testName, test);
                file.Html(x => x.Add("br"));
                file.Html(
                    x => x.Add("a").Text(test.Name).AddClass("test-link").Attr("title", testName).Attr("href", "#"));
            });


            return(file);
        }
Esempio n. 7
0
        public void SetUp()
        {
            var library = FixtureLibrary.For(x => x.AddFixture <RecordingFixture>());

            system = new RecordingSystem();
            var fixtureContainerSource = new FixtureContainerSource(new Container(x =>
            {
                x.For <IFixture>().Add <RecordingFixture>().Named("Recording");
            }));

            fixtureContainerSource.RegisterFixture("Recording", typeof(RecordingFixture));

            runner = new TestRunner(system, library, fixtureContainerSource);

            var test = new Test("something");

            test.Add(new Section("Recording").WithStep("Execute"));

            runner.RunTest(new TestExecutionRequest()
            {
                Test             = test,
                TimeoutInSeconds = 1200
            });

            runner.RunTest(new TestExecutionRequest()
            {
                Test             = test,
                TimeoutInSeconds = 1200
            });
        }
Esempio n. 8
0
        public void SetUp()
        {
            var library = FixtureLibrary.For(x => x.AddFixture <SampleTableFixture>());

            table = (Table)library.FixtureFor("SampleTable").GrammarFor("Table1");

            tag = new TableTemplateTag(table, new CellBuilderLibrary());
        }
Esempio n. 9
0
 public void SetUp()
 {
     library = FixtureLibrary.For(x =>
     {
         x.AddFixture <SentenceFixture>();
         x.AddFixture <MandatorySelectionFixture>();
     });
 }
Esempio n. 10
0
        public void SetUp()
        {
            FixtureLibrary library =
                FixtureLibrary.For(x => x.AddFixturesFromAssemblyContaining <EmbeddedChoicesFixture>());

            // Look for the EmbeddedChoicesFixture
            fixture    = library.FixtureFor("EmbeddedChoices");
            fixtureTag = new FixtureTag(fixture);
        }
Esempio n. 11
0
        public void SetUp()
        {
            FixtureLibrary library = FixtureLibrary.For(x => x.AddFixture <SentenceTargetFixture>());

            grammarTag =
                new GrammarTag(library.FixtureFor(typeof(SentenceTargetFixture).GetFixtureAlias()).GrammarFor("Go"));
            var writer = new SentenceWriter(grammarTag, new CellBuilderLibrary());

            writer.Write();
        }
Esempio n. 12
0
        public void do_not_write_remove_link_for_the_mandatory_autoselect_grammar()
        {
            var fixture =
                FixtureLibrary.For(x => x.AddFixture <MandatorySelectionFixture>()).FixtureFor("MandatorySelection");

            var fixtureTag = new FixtureTag(fixture);

            fixtureTag.Children.First(x => x.HasClass("StartWithTheNumber")).Children.Any(x => x is RemoveLinkTag).
            ShouldBeFalse();
        }
 public JavaScriptTestFile MandatoryAutoSelect()
 {
     return(new JavaScriptTestFile("Mandatory Auto Selection Behavior")
            .Fixtures(x => x.AddFixturesFromAssemblyContaining <SentenceFixture>())
            .TestFile("MandatorySelectionTester.js")
            .AddTest("mandatoryTest", new Test("madatoryTest", x => x.Add(new Section("MandatorySelection"))))
            .Html(x =>
     {
         var testEditor =
             new TestEditorTag(FixtureLibrary.For(o => o.AddFixturesFromAssemblyContaining <SentenceFixture>()));
         x.Add("div").Append(testEditor);
     }));
 }
 public JavaScriptTestFile OneOrMoreSelectionMode()
 {
     return(new JavaScriptTestFile("One Or More Selection Mode Tester")
            .Fixtures(x => x.AddFixturesFromAssemblyContaining <SentenceFixture>())
            .TestFile("OneOrMoreSelectionModeTester.js")
            .AddTest("singleTest", new Test("single", x => x.Add(new Section("OneOrMoreSelection"))))
            .Html(x =>
     {
         var testEditor =
             new TestEditorTag(FixtureLibrary.For(o => o.AddFixturesFromAssemblyContaining <SentenceFixture>()));
         x.Add("div").Append(testEditor);
     }));
 }
Esempio n. 15
0
        public void SetUp()
        {
            var library = FixtureLibrary.For(x => x.AddFixture <RecordingFixture>());

            system = new RecordingSystem();


            var fixtureContainerSource = new FixtureContainerSource(new Container(x =>
            {
                x.For <IFixture>().Add <RecordingFixture>().Named("Recording");
            }));

            fixtureContainerSource.RegisterFixture("Recording", typeof(RecordingFixture));

            runner = new TestRunner(system, library, fixtureContainerSource);

            runner.Dispose();
        }
Esempio n. 16
0
 public void SetUp()
 {
     library = FixtureLibrary.For(x => x.AddFixturesFromAssemblyContaining <SentenceFixture>());
     tag     = new TestEditorTag(library);
 }
Esempio n. 17
0
 public void SetUp()
 {
     baseLibrary = FixtureLibrary.For(x => x.AddFixturesFromAssemblyContaining <MathFixture>());
     library     = baseLibrary.Filter(f => f.Name == "Sentence" || f.Name == "Sets");
 }
Esempio n. 18
0
        public JavaScriptTestFile Fixtures(Action <FixtureRegistry> configure)
        {
            FixtureLibrary fixtureLibrary = FixtureLibrary.For(configure);

            return(Fixtures(fixtureLibrary));
        }