private static void AssertQuery(string columnName, string headerCellName) { var dataTable = new DataTable(); dataTable.Columns.Add("somekey", typeof(string)); dataTable.Columns.Add(columnName, typeof(string)); var newRow = dataTable.NewRow(); newRow["somekey"] = "key"; newRow[columnName] = "value"; dataTable.Rows.Add(newRow); var fixture = new Query(dataTable, false) { Processor = new Service() }; var testTable = new CellBaseTree( new CellBaseTree("query"), new CellBaseTree("somekey", headerCellName), new CellBaseTree("key", "value") ); Parse parseTable = Parse.CopyFrom(testTable); fixture.DoTable(parseTable); Assert.AreEqual(TestStatus.Right, parseTable.At(0, 2, 0).GetAttribute(CellAttribute.Status)); Assert.AreEqual(TestStatus.Right, parseTable.At(0, 2, 1).GetAttribute(CellAttribute.Status)); }
private static void AssertQuery(string columnName, string headerCellName) { var dataTable = new DataTable(); dataTable.Columns.Add("somekey", typeof (string)); dataTable.Columns.Add(columnName, typeof (string)); var newRow = dataTable.NewRow(); newRow["somekey"] = "key"; newRow[columnName] = "value"; dataTable.Rows.Add(newRow); var fixture = new Query(dataTable, false) {Processor = new Service()}; var testTable = new CellBaseTree( new CellBaseTree("query"), new CellBaseTree("somekey", headerCellName), new CellBaseTree("key", "value") ); Parse parseTable = Parse.CopyFrom(testTable); fixture.DoTable(parseTable); Assert.AreEqual(TestStatus.Right, parseTable.At(0, 2, 0).GetAttribute(CellAttribute.Status)); Assert.AreEqual(TestStatus.Right, parseTable.At(0, 2, 1).GetAttribute(CellAttribute.Status)); }