public void FitNessePageLoadTableFromPageNegativeTestCases(string tableName, string page) { var fitnessePage = new FitNessePageMock(page); var dict = fitnessePage.LoadTableFromPage("tableName", tableName); Assert.AreEqual(dict.Count, 0, tableName); }
public void FitNessePageLoadTableFromPageTestsWithOneResult(string testCase, string inputPage) { var fitnessePage = new FitNessePageMock(inputPage); var dict = fitnessePage.LoadTableFromPage("Main", testCase); Assert.AreEqual(1, dict.Count, "Entry Count for testcase " + testCase); Assert.AreEqual("value", dict["key"], "Entry for testcase " + testCase); }
public void FitNessePageSavePageTest() { const string pageContent = "\nq\n|Dictionary|TableName|\n|Key|Value|\n|key1|value1|\nq\n"; var fitnessePage = new FitNessePageMock(pageContent); fitnessePage.LoadTableFromPage("TableName", "PageName"); _savePageMethod.Invoke(fitnessePage, new object[] { "PageName" }); const string expected = PageDataRequest + DeletePageRequest + AddChildPartialRequest + "\nq\n|Dictionary|TableName|\n|Key|Value|\n|key1|value1|\nq\n" + UriSeparator; Assert.AreEqual(expected, fitnessePage.UsedUri); }
public void FitNessePageInsertTableAtTests(string testCase, string inputPage, int lineIndex, string expectedResult) { var dict = new Dictionary <string, string> { { "key5", "value5" }, { "key6", "value6" } }; var fitnessePage = new FitNessePageMock(inputPage); fitnessePage.LoadTableFromPage("TableName", "PageName"); _insertTableAtMethod.Invoke(fitnessePage, new object[] { "NewTableName", dict, lineIndex }); _savePageMethod.Invoke(fitnessePage, new object[] { "PageName" }); var expected = PageDataRequest + DeletePageRequest + AddChildPartialRequest + expectedResult; Assert.AreEqual(expected, fitnessePage.UsedUri, "Testcase " + testCase); }