public WorkItem Get(int id) { var workItemFactory = new WorkItemDAL(this.connectionString); var dataTable = workItemFactory.WorkItem_Get(id); if (dataTable == null) { throw new ApplicationException("WorkItem_Get returned null instead of a DataTable"); } else if (dataTable.Rows.Count < 1) { throw new ApplicationException("Not enough DataRows returned by WorkItem_Get"); } else if (dataTable.Rows.Count > 1) { throw new ApplicationException("Too many DataRows returned by WorkItem_Get"); } else { return HydrateWorkItem(dataTable.Rows[0]); } }
public void WorkItem_GetTest() { string connectionString = string.Empty; // TODO: Initialize to an appropriate value WorkItemDAL target = new WorkItemDAL(connectionString); // TODO: Initialize to an appropriate value int workItemId = 1; // TODO: Initialize to an appropriate value DataTable expected = null; // TODO: Initialize to an appropriate value DataTable actual; actual = target.WorkItem_Get(workItemId); Assert.AreEqual(expected, actual); Assert.Inconclusive("Verify the correctness of this test method."); }