示例#1
0
 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));
 }
示例#2
0
 public void TestWriteFinalCounts()
 {
     _strategy = new XmlResultWriter(TEST_RESULT_FILE_NAME, _folderModel);
     _strategy.WriteFinalCount(MakeTestCounts());
     _strategy.Close();
     Assert.AreEqual(BuildFinalCountsString(1, 2, 3, 4),
                     _folderModel.FileContent(TEST_RESULT_FILE_NAME));
 }
示例#3
0
 public void TestWriteIllegalCharacters()
 {
     const string pageName = "Test Page";
     var pageResult = new PageResult(pageName, "<table><tr><td>Text</td></tr>\x02</table>", MakeTestCounts());
     _strategy = new XmlResultWriter(TEST_RESULT_FILE_NAME, _folderModel);
     _strategy.WritePageResult(pageResult);
     _strategy.Close();
     Assert.AreEqual(
         BuildPageResultString(pageName, "<![CDATA[<table><tr><td>Text</td></tr>&#2;</table>]]>", 1, 2, 3, 4),
         _folderModel.FileContent(TEST_RESULT_FILE_NAME));
 }
示例#4
0
 public void TestWriteResults()
 {
     const string pageName = "Test Page";
     var pageResult = new PageResult(pageName, "<table border=\"1\" cellspacing=\"0\">\r\n<tr><td>Text</td>\r\n</tr>\r\n</table>", MakeTestCounts());
     _strategy = new XmlResultWriter(TEST_RESULT_FILE_NAME, _folderModel);
     _strategy.WritePageResult(pageResult);
     _strategy.Close();
     Assert.AreEqual(
         BuildPageResultString(pageName, "<![CDATA[<table border=\"1\" cellspacing=\"0\">\r\n<tr><td>Text</td>\r\n</tr>\r\n</table>]]>", 1, 2, 3, 4),
         _folderModel.GetPageContent(TEST_RESULT_FILE_NAME));
 }
示例#5
0
 public void TestCloseWithStandardOut()
 {
     _strategy = new XmlResultWriter("stdout", _folderModel);
     _strategy.Close();
     Assert.IsFalse(_folderModel.FileExists(TEST_RESULT_FILE_NAME));
 }