using the following in Moq
public Mock<HttpRequestBase> Request { get; set; }
how can I mock this Request[....]
(in controller)
var modelFromPost = Request["mymodel"]
here's what I have so far
public class ContextMocks
{
public Mock<HttpContextBase> HttpContext { get; set; }
public Mock<HttpRequestBase> Request { get; set; }
public RouteData RouteData { get; set; }
public ContextMocks(Controller controller)
{
HttpContext = new Mock<HttpContextBase>();
HttpContext.Setup(x => x.Request).Returns(Request.Object);
}
}
cheers!