public void Test() { IDbProvider dbProvider = DbProviderFactory.GetDbProvider("System.Data.SqlClient"); dbProvider.ConnectionString = @"Data Source=MARKT60\SQL2005;Database=Spring;User ID=springqa;Password=springqa;Trusted_Connection=False"; TestObjectStoredProc sp = new TestObjectStoredProc(dbProvider); IList <TestObject> testObjectList = sp.GetByName("George"); Assert.IsNotNull(testObjectList); TestObjectandVacationStoredProc vsp = new TestObjectandVacationStoredProc(dbProvider); System.Collections.IDictionary outParams = vsp.ExecStoreProc("George"); testObjectList = outParams["testObjectRowMapper"] as IList <TestObject>; Assert.IsNotNull(testObjectList); Assert.AreEqual(1, testObjectList.Count); IList <Vacation> vacationList = outParams["vacationRowMapper"] as IList <Vacation>; Assert.IsNotNull(vacationList); Assert.AreEqual(2, vacationList.Count); }
public void MultipleTableStoredProcedure_ReturnsResult() { TestObjectandVacationStoredProc vsp = new TestObjectandVacationStoredProc(_dbProvider); IDictionary outParams = vsp.ExecStoreProc("Jack"); IList <TestObject> testObjectList = testObjectList = outParams["testObjectRowMapper"] as IList <TestObject>; Assert.IsNotNull(testObjectList); Assert.AreEqual(1, testObjectList.Count); IList <Vacation> vacationList = outParams["vacationRowMapper"] as IList <Vacation>; Assert.IsNotNull(vacationList); Assert.AreEqual(2, vacationList.Count); }
public void Test() { IDbProvider dbProvider = DbProviderFactory.GetDbProvider("System.Data.SqlClient"); dbProvider.ConnectionString = @"Data Source=MARKT60\SQL2005;Database=Spring;User ID=springqa;Password=springqa;Trusted_Connection=False"; TestObjectStoredProc sp = new TestObjectStoredProc(dbProvider); IList<TestObject> testObjectList = sp.GetByName("George"); Assert.IsNotNull(testObjectList); TestObjectandVacationStoredProc vsp = new TestObjectandVacationStoredProc(dbProvider); System.Collections.IDictionary outParams = vsp.ExecStoreProc("George"); testObjectList = outParams["testObjectRowMapper"] as IList<TestObject>; Assert.IsNotNull(testObjectList); Assert.AreEqual(1, testObjectList.Count); IList<Vacation> vacationList = outParams["vacationRowMapper"] as IList<Vacation>; Assert.IsNotNull(vacationList); Assert.AreEqual(2, vacationList.Count); }
public void MultipleTableStoredProcedure_ReturnsResult() { TestObjectandVacationStoredProc vsp = new TestObjectandVacationStoredProc(_dbProvider); IDictionary outParams = vsp.ExecStoreProc("Jack"); IList<TestObject> testObjectList = testObjectList = outParams["testObjectRowMapper"] as IList<TestObject>; Assert.IsNotNull(testObjectList); Assert.AreEqual(1, testObjectList.Count); IList<Vacation> vacationList = outParams["vacationRowMapper"] as IList<Vacation>; Assert.IsNotNull(vacationList); Assert.AreEqual(2, vacationList.Count); }