public void ChangeContactNameTest_() { ITestControl control = adapter.CreateTestControl(TestControlType.Table, ""); IGridBase table = control.GetInterface <IGridBase>(); Assert.AreEqual(2, table.GetRowCount()); List <IGridColumn> columns = new List <IGridColumn>(table.Columns); IGridColumn column = commandAdapter.GetColumn(control, "Full Name"); Assert.AreEqual("John Nilsen", table.GetCellValue(0, column)); Assert.AreEqual("Mary Tellitson", table.GetCellValue(1, column)); commandAdapter.ProcessRecord("Contact", new string[] { "Full Name" }, new string[] { "Mary Tellitson" }, ""); Assert.AreEqual("Mary Tellitson", commandAdapter.GetFieldValue("Full Name")); Assert.AreEqual("Development Department", commandAdapter.GetFieldValue("Department")); Assert.AreEqual("Manager", commandAdapter.GetFieldValue("Position")); commandAdapter.DoAction("Edit", null); commandAdapter.SetFieldValue("First Name", "User_1"); commandAdapter.SetFieldValue("Last Name", "User_2"); commandAdapter.SetFieldValue("Position", "Developer"); commandAdapter.DoAction("Save", null); Assert.AreEqual("User_1 User_2", commandAdapter.GetFieldValue("Full Name")); Assert.AreEqual("Developer", commandAdapter.GetFieldValue("Position")); }
internal string GetCellValue(string tableName, int row, string columnName) { ITestControl testControl = adapter.CreateTestControl(TestControlType.Table, tableName); IGridBase gridControl = testControl.GetInterface <IGridBase>(); return(gridControl.GetCellValue(row, GetColumn(testControl, columnName))); }