public MockService RespondWith(Action <IOwinContext> responseConfiguration) { if (responseConfiguration == null) { throw new ArgumentNullException("responseConfiguration"); } Func <IOwinContext, Task> responseFunction = c => { responseConfiguration(c); return(Task.FromResult <object>(null)); }; _mockService.Setup(_requestValidator, responseFunction); return(_mockService); }