public void TestCloseWithFileName() { _strategy = new XmlResultWriter(TEST_RESULT_FILE_NAME, _folderModel); _strategy.Close(); Assert.IsTrue(_folderModel.FileExists(TEST_RESULT_FILE_NAME)); Assert.AreEqual("<?xml version=\"1.0\" encoding=\"utf-16\"?>\r\n<testResults />", _folderModel.FileContent(TEST_RESULT_FILE_NAME)); }
[Test] public void ExecutesSuiteTearDownLast() { AddTestFile(@"in\suiteteardown.html"); AddTestFile(@"in\zzzz.html"); RunSuite(); int tearDown = folders.FileContent(@"out\reportIndex.html").IndexOf("suiteteardown.html"); int otherFile = folders.FileContent(@"out\reportIndex.html").IndexOf("zzzz.html"); Assert.IsTrue(otherFile < tearDown); }
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); }
[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); }
public void TestWriteResults() { var pageResult = new PageResult("Test Page", "content", TestUtils.MakeTestCounts()); _strategy = new TextResultWriter(TEST_RESULT_FILE_NAME, _folderModel); _strategy.WritePageResult(pageResult); _strategy.Close(); Assert.AreEqual("0000000060Test Page\n1 right, 2 wrong, 3 ignored, 4 exceptions\ncontent\n", _folderModel.FileContent(TEST_RESULT_FILE_NAME)); }