Hi Everyone,
Not sure if it belongs here or on the Rhino.Mocks group. I’m using
rhino.commons and would like to test the following piece of
code below but I’m having trouble Mokin
UnitOfWork.Current.BeginTransaction(). I was able to mock the unit of
work doing the following:
var theStubUnitOfWork = MockRepository.GenerateMock<IUnitOfWork>();
UnitOfWork.RegisterGlobalUnitOfWork(theStubUnitOfWork);
But I want to be able to do something similar with RhinoTransaction, I
have tried this: var tx =
MockRepository.GenerateMock<RhinoTransaction>();
But how do I register it as a global. Any help would be appreciated
and thanks in advanced.
if (isAllowedToRemove && hasAccessOnOrg)
{
RhinoTransaction tx =
UnitOfWork.Current.BeginTransaction();
try
{
//do stuff
tx.Commit();
}
catch
{
tx.Rollback();
}
finally
{
tx.Dispose();
}
}
--
You received this message because you are subscribed to the Google Groups
"Rhino Tools Dev" 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/rhino-tools-dev?hl=en.