I'm trying to use RhinoMocks to stub out a third party component. The third party component looks like the following.
public class connection
{
public connection(string host,int port)
{}
public void Submit(message msg)
{}
}
public class message
{
public message(string recipient)
{}
{
When I attempt to use a stub it instead returns an actual instance of the object and my message will actually be sent if I use a valid host and port. If I don't use a valid host or port the constructor on the connection object throws an exception. I don't want a real object I just want a stub. What am I missing? Below is my code.
Connection con = MockRepository.GenerateStub<Connection>("host", 25);
Message msg = new Message("[email protected]");
msg.AddRecipient(new Recipient("[email protected]"));
con.Submit(msg);