Updated: See end of question for how I implemented the solution.
Sorry for the poorly-worded question, but I wasn\'t sure how best to ask it. I\'m not sure
I would say use Dependecy Injection. Basically, you pass an abstraction of the send method.
Something like:
interface IVendorMessageSender
{
void SendMessage(Vendor v);
}
public class OutboxManager
{
IVendorMessageSender _sender;
public OutboxManager(IVendorMessageSender sender)
{
this._sender = sender; //Use it in other methods to call the concrete implementation
}
...
}
Another approach, as already mentioned, inheritance.
In either case: try to remove DB retrieval code from this class. Use another abstraction for that (ie: passing an IDataProvider interface or something like that to the constructor). It will make your code more testable.