public void ExecuteAndReturnDataSet_ThrowsAnExceptionGivenAnInvalidCommand() { var database = new SqlDb(_testConn); var testCommand = new SqlCommand(); database.ExecuteAndReturnDataTable(testCommand, "ExecuteAndReturnDataTable test failed"); Assert.AreEqual(0, 0); }
public void ExecuteAndReturnDataTable_GivenAValidCommandReturnsExpectedDataTable() { var database = new SqlDb(_testConn); var testCommand = StoredProcedureFactory.Create("SqlDb_ExecuteAndReturnDataTableTestProcedure1"); var testData = new List<TestTableItem> { new TestTableItem {ID = 1, Field1 = "Testing123"}, new TestTableItem {ID = 2, Field1 = "TestRecord"} }; var dtExpectedResult = TestData.ListToTable(testData); var dtActualResult = database.ExecuteAndReturnDataTable(testCommand, "ExecuteAndReturnDataTable test failed"); DataTableAssert.AllDataMatches(dtExpectedResult, dtActualResult); }