How can I enforce a stub object in RhinoMocks to return void for a void method on it?
Take this example:
public interface ICar
{
string Model {get;set;}
void Horn();
}
ICar stubCar= MockRepository.GenerateStub<ICar>();
stubCar.Expect(c=>c.Horn()).Return( //now what so that
// it returns nothing as the meth. returns void ?
The method can't return a value - it's a void method. The CLR won't let it try to return a value. You don't need to test for this.
You only need the Expect
call.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With