Beispiel #1
0
        [Test] public void CustomAppConfigFromSuiteConfigIsUsed()
        {
            var folders = new FolderTestModel();

            folders.MakeFile("suite.config.xml", "<config><Settings><AppConfigFile>fitSharpTest.dll.alt.config</AppConfigFile></Settings></config>");
            folders.MakeFile(System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "fitSharpTest.dll.alt.config"), "stuff");
            var result = RunShell(new[] { "-c", "suite.config.xml",
                                          "-r", typeof(SampleRunner).FullName + "," + typeof(SampleRunner).Assembly.CodeBase }, folders);

            Assert.AreEqual(606, result);
        }
 public void ExecutesSuiteTearDownLast()
 {
     var folders = new FolderTestModel();
     folders.MakeFile("in\\suiteteardown.html", "<table><tr><td>fixture</td></tr></table>");
     folders.MakeFile("in\\zzzz.html", "<table><tr><td>fixture</td></tr></table>");
     var config = new Configuration();
     config.GetItem<Settings>().InputFolder = "in";
     config.GetItem<Settings>().OutputFolder = "out";
     var runner = new SuiteRunner(config, new NullReporter());
     runner.Run(new StoryTestFolder(config, folders), string.Empty);
     int tearDown = folders.FileContent("out\\reportIndex.html").IndexOf("suiteteardown.html");
     int otherFile = folders.FileContent("out\\reportIndex.html").IndexOf("zzzz.html");
     Assert.IsTrue(otherFile < tearDown);
 }
Beispiel #3
0
        void MakePage(string pagePath)
        {
            var pageSource = new FolderTestModel();

            pageSource.MakeFile(pagePath, pageContent);
            processor.Get <Context>().PageSource = pageSource;
        }
Beispiel #4
0
        [Test] public void ApartmentStateFromSuiteConfigIsUsed()
        {
            var folders = new FolderTestModel();

            folders.MakeFile("suite.config.xml", "<config><Settings><ApartmentState>STA</ApartmentState></Settings></config>");
            RunShell(new[] { "-r", typeof(SampleRunner).FullName, "-c", "suite.config.xml" }, folders);
            Assert.AreEqual(ApartmentState.STA, SampleRunner.ApartmentState);
        }
Beispiel #5
0
        [Test] public void ExecutesSuiteTearDownLast()
        {
            var folders = new FolderTestModel();

            folders.MakeFile("in\\suiteteardown.html", "<table><tr><td>fixture</td></tr></table>");
            folders.MakeFile("in\\zzzz.html", "<table><tr><td>fixture</td></tr></table>");
            var config = new Configuration();

            config.GetItem <Settings>().InputFolder  = "in";
            config.GetItem <Settings>().OutputFolder = "out";
            var runner = new SuiteRunner(config, new NullReporter());

            runner.Run(new StoryTestFolder(config, folders), string.Empty);
            int tearDown  = folders.FileContent("out\\reportIndex.html").IndexOf("suiteteardown.html");
            int otherFile = folders.FileContent("out\\reportIndex.html").IndexOf("zzzz.html");

            Assert.IsTrue(otherFile < tearDown);
        }
Beispiel #6
0
        [Test] public void CustomAppConfigFromSuiteConfigIsUsed()
        {
            var folders = new FolderTestModel();

            folders.MakeFile("suite.config.xml", "<config><Settings><AppConfigFile>fitSharpTest.dll.alt.config</AppConfigFile></Settings></config>");
            int result = RunShell(new[] { "-c", "suite.config.xml",
                                          "-r", typeof(SampleRunner).FullName + "," + typeof(SampleRunner).Assembly.CodeBase }, folders);

            Assert.AreEqual(606, result);
        }
Beispiel #7
0
        [Test] public void RunnerFromSuiteConfigIsUsed()
        {
            var folders = new FolderTestModel();

            folders.MakeFile("suite.config.xml", "<config><Settings><Runner>"
                             + typeof(SampleRunner).FullName + "," + typeof(SampleRunner).Assembly.CodeBase
                             + "</Runner></Settings></config>");
            int result = RunShell(new[] { "-c", "suite.config.xml" }, folders);

            Assert.AreEqual(SampleRunner.Result, result);
        }
        StoryTestFile MakeStoryTestFile(string fileName)
        {
            folder.MakeFile(fileName, "stuff");
            var memory = new TypeDictionary();

            memory.GetItem <Settings>().OutputFolder = "output";
            var file = new StoryTestFile(fileName,
                                         new StoryTestFolder(memory, folder, new Filters(string.Empty, new FileExclusions(), string.Empty)), folder);

            return(file);
        }
Beispiel #9
0
        [Test] public void ApartmentStateFromSuiteConfigIsUsed()
        {
            if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
            {
                return;                                                       //apartment state only supported on windows
            }
            var folders = new FolderTestModel();

            folders.MakeFile("suite.config.xml", "<config><Settings><ApartmentState>STA</ApartmentState></Settings></config>");
            RunShell(new[] { "-r", typeof(SampleRunner).FullName, "-c", "suite.config.xml" }, folders);
            Assert.AreEqual(ApartmentState.STA, SampleRunner.ApartmentState);
        }
Beispiel #10
0
 private void AddTestFile(string path)
 {
     folders.MakeFile(path, "<table><tr><td>fixture</td></tr></table>");
 }
Beispiel #11
0
 private void AddTestFile(string path, string file)
 {
     folders.MakeFile(System.IO.Path.Combine(path, file), "<table><tr><td>fixture</td></tr></table>");
 }