Here is the code:
public class DALAccounts : IDALAccounts
{
IConnectionHelper factory = DataConnection.GetConnection();
public List<Result> UpdateAccount(string accountId, string
accountInfo)
{
List<Result> result = null;
factory.ExecuteTransaction(tran =>
{
tran.ExecuteQuery(query =>
{
query.AddParameter(...)
DataReader dr = query.ExecuteReaderWithProc();
result = dr.GetData<Result>(Result.Map);
});
});
return result;
}
}
Test Method:
public void UpdateAccountTest()
{
var accountMock = MockRepository.GenerateStub(IDALAccounts);
accountMock.Stub(x => x.UpdateAccount(accountId,
accountInfo)).Return(fakeResultList);
List<Result> results = accountMock.UpdateAccount(accountId,
accountInfo);
Assert.AreEqual(results[0].ReturnValue, "00");
}
My concern is I am just calling the mock method and not even getting
inside the actual method. Even if I mock IConnectionHelper, I will be
able to reach code upto ExecuteTransaction but won't go further down.
Am I missing anything?? Is it possible to do something more here??
Anyways, ExecuteTransaction and ExecuteQuery are methods from a common
library that takes 1 parameter Action delegates.
Any help would be highly appreciated!!
Thanks in advance.
--
You received this message because you are subscribed to the Google Groups
"Rhino.Mocks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rhinomocks?hl=en.