public void ExecuteAndReturnDataSet_GivenAValidCommandReturnsExpectedDataSet() { var database = new SqlDb(_testConn); var testCommand = StoredProcedureFactory.Create("SqlDb_ExecuteAndReturnDataSetTestProcedure1"); var testData1 = new List<TestTableItem>(); var testData2 = new List<TestTableItem>(); var testDataTable1 = TestData.ListToTable(testData1); var testDataTable2 = TestData.ListToTable(testData2); var expectedDataSet = new DataSet(); expectedDataSet.Tables.Add(testDataTable1); expectedDataSet.Tables.Add(testDataTable2); var actualDataSet = database.ExecuteAndReturnDataSet(testCommand, "ExecuteAndReturnDataSet test failed"); DataSetAssert.AllDataMatches(expectedDataSet, actualDataSet); }
public void ExecuteAndReturnDataSet_ThrowsAnExceptionWhenCommandDoesntExist() { var database = new SqlDb(_testConn); var testCommand = StoredProcedureFactory.Create("BogusCommand"); database.ExecuteAndReturnDataSet(testCommand, "ExecuteAndReturnDataSet test failed"); }