示例#1
0
        void MakePage(string pagePath)
        {
            var pageSource = new FolderTestModel();

            pageSource.MakeFile(pagePath, pageContent);
            processor.Get <Context>().PageSource = pageSource;
        }
示例#2
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);
        }
示例#3
0
        [SetUp] public void SetUp()
        {
            memory = new TypeDictionary();
            memory.GetItem <Settings>().InputFolder  = "in";
            memory.GetItem <Settings>().OutputFolder = "out";

            folders = new FolderTestModel();
        }
示例#4
0
 static void CheckResult(string content, string expected) {
     var folder = new FolderTestModel();
     var memory = new TypeDictionary();
     memory.GetItem<Settings>().OutputFolder = "output";
     var file = new StoryTestFile("myfile", new StoryTestFolder(memory, folder), folder);
     file.WriteTest(new PageResult("title", content, new TestCounts()));
     Assert.AreEqual(expected, folder.GetPageContent(new FilePath("output\\myfile.html")));
 }
示例#5
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);
        }
示例#6
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);
        }
示例#7
0
        static void CheckResult(string content, string expected)
        {
            var folder = new FolderTestModel();
            var memory = new TypeDictionary();

            memory.GetItem <Settings>().OutputFolder = "output";
            var file = new StoryTestFile("myfile", new StoryTestFolder(memory, folder), folder);

            file.WriteTest(new PageResult("title", content, new TestCounts()));
            Assert.AreEqual(expected, folder.GetPageContent(new FilePath("output\\myfile.html")));
        }
示例#8
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);
        }
示例#9
0
 static void CheckResult(string content, string expected)
 {
     Clock.Instance = new TestClock {Now = new DateTime(2016, 1, 2, 13, 14, 15)};
     var folder = new FolderTestModel();
     var memory = new TypeDictionary();
     memory.GetItem<Settings>().OutputFolder = "output";
     var file = new StoryTestFile("myfile", new StoryTestFolder(memory, folder), folder);
     file.WriteTest(new PageResult("title", content, new TestCounts()));
     Clock.Instance = new Clock();
     Assert.AreEqual(comment + expected, folder.GetPageContent(new FilePath("output\\myfile.html")));
 }
示例#10
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);
        }
示例#11
0
 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);
 }
示例#12
0
        static void CheckResult(string content, string expected)
        {
            Clock.Instance = new TestClock {
                Now = new DateTime(2016, 1, 2, 13, 14, 15)
            };
            var folder = new FolderTestModel();
            var memory = new TypeDictionary();

            memory.GetItem <Settings>().OutputFolder = "output";
            var file = new StoryTestFile("myfile", new StoryTestFolder(memory, folder), folder);

            file.WriteTest(new PageResult("title", content, new TestCounts()));
            Clock.Instance = new Clock();
            Assert.AreEqual(comment + expected, folder.GetPageContent(new FilePath("output\\myfile.html")));
        }
示例#13
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);
        }
示例#14
0
 public void SetUp()
 {
     folderModel = new FolderTestModel();
 }
示例#15
0
 public void SetUp()
 {
     _folderModel = new FolderTestModel();
 }
示例#16
0
        public void SetUp()
        {
            memory = new TypeDictionary();
            memory.GetItem<Settings>().InputFolder = "in";
            memory.GetItem<Settings>().OutputFolder = "out";

            folders = new FolderTestModel();
        }