private static void TestTable(string searchCriterion, IReadOnlyList <string> header, string[,] expectedValues) { var etv = new ExtractGrid(searchCriterion); var table = etv.Query(); Assert.IsNotNull(table); Assert.AreEqual(expectedValues.GetLength(0), table.Count, "Row Count for {0}", searchCriterion); for (var row = 0; row < table.Count; row++) { var rowCollection = table[row] as Collection <object>; Assert.IsNotNull(rowCollection); Assert.AreEqual(expectedValues.GetLength(1), rowCollection.Count, "Column Count for {0}", searchCriterion); for (var column = 0; column < rowCollection.Count; column++) { var columnCollection = rowCollection[column] as Collection <object>; Assert.IsNotNull(columnCollection); Assert.AreEqual(2, columnCollection.Count, "Cell Count for {0}({1},{2})", searchCriterion, row, column); Assert.AreEqual(header[column], columnCollection[0], "Header for {0}({1},{2})", searchCriterion, row, column); Assert.AreEqual(expectedValues[row, column], columnCollection[1], "value for {0}({1},{2})", searchCriterion, row, column); } } }
public void ExtractGridNotfoundTest() { var fixture = new ExtractGrid("dummy"); Assert.IsNull(fixture.Query()); }