I have this type:
[RequiresAuthentication]
public class MobileRunReportHandler : IMobileRunReportHandler
{
public void Post(MobileRunReport report)
{
...
}
}
I am mocking it like so:
var handler = MockRepository.GenerateStub<IMobileRunReportHandler>();
handler.Stub(x => x.Post(mobileRunReport));
The problem is that the produced mock is not attributed with the RequiresAuthentication
attribute. How do I fix it?
Thanks.
EDIT
I want the mocked type to be attributed with the RequiresAuthentication
attribute, because the code that I am testing makes use of this attribute. I would like to know how can I change my mocking code to instruct the mocking framework to attribute the produced mock accordingly.