Пример #1
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.FileContent(TEST_RESULT_FILE_NAME));
 }
Пример #2
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));
 }