public void TestCloseWithFileName() { _strategy = new XmlResultWriter(TEST_RESULT_FILE_NAME, _folderModel); _strategy.Close(); Assert.IsTrue(_folderModel.Exists(TEST_RESULT_FILE_NAME)); Assert.AreEqual("<?xml version=\"1.0\" encoding=\"utf-16\"?>\r\n<testResults />", _folderModel.GetPageContent(TEST_RESULT_FILE_NAME)); }
public void TestCloseWithFileName() { strategy = new XmlResultWriter(testResultFileName, folderModel); strategy.Close(); Assert.IsTrue(folderModel.Exists(testResultFileName)); Assert.AreEqual("<?xml version=\"1.0\" encoding=\"utf-16\"?>" + Environment.NewLine + "<testResults />", folderModel.GetPageContent(testResultFileName)); }
[Test] public void ExecutesSuiteTearDownLast() { AddTestFile(@"in\suiteteardown.html"); AddTestFile(@"in\zzzz.html"); RunSuite(); int tearDown = folders.GetPageContent(@"out\reportIndex.html").IndexOf("suiteteardown.html"); int otherFile = folders.GetPageContent(@"out\reportIndex.html").IndexOf("zzzz.html"); Assert.IsTrue(otherFile < tearDown); }
[Test] public void ExecutesSuiteTearDownLast() { AddTestFile("in", "suiteteardown.html"); AddTestFile("in", "zzzz.html"); RunSuite(); var report = System.IO.Path.Combine("out", "reportIndex.html"); int tearDown = folders.GetPageContent(report).IndexOf("suiteteardown.html", StringComparison.Ordinal); int otherFile = folders.GetPageContent(report).IndexOf("zzzz.html", StringComparison.Ordinal); Assert.IsTrue(otherFile < tearDown); }
void CheckResult(string content, string expected) { Clock.Instance = new TestClock { Now = new DateTime(2016, 1, 2, 13, 14, 15) }; var file = MakeStoryTestFile("myfile"); file.WriteTest(new PageResult("title", content, new TestCounts())); Clock.Instance = new Clock(); Assert.AreEqual(comment + expected, folder.GetPageContent(new FilePath("output\\myfile.html"))); }
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"))); }
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"))); }