With.Transaction uses UnitOfWork.Current property. UnitOfWork is a static class -- you can't mock it with RhinoMocks.
UnitOfWork.Current is a public static property, so you can swap it out. Unfortunately, the setter is internal.
I see 3 options for you:
Modify the Rhino.Commons source to make UnitOfWork.Current setter
public, and set it in your unit test.
Use reflection to set the UnitOfWork.Current to your fake unit
of work.
Since UnitOfWork.Current internally uses Local.Data to find the current
transaction, you should be able to
go:
Rhino.Commons.Local.Data[UnitOfWork.CurrentUnitOfWorkKey] = myFakeUnitOfWork;
One bit of good news is that UnitOfWork.Current is an IUnitOfWork, and RhinoMocks can easily fake interfaces.
I must finish by saying, I'm not very familiar with Rhino.Commons, so Ayende might have built a proper way of faking UnitOfWork. If this is super-important to you, you ought to ask in the Rhino discussion groups.