我一直在查看hanselman 的文章,我想真正深入了解以下代码的工作原理。它看起来像泛型和扩展方法?我应该熟悉哪些其他主题才能真正理解以下代码。为了理解文章中提到的整个代码库,我需要知道什么类型的主题(如泛型、扩展方法???)。谢谢
public static HttpContextBase FakeHttpContext()
{
var context = new Mock<HttpContextBase>();
var request = new Mock<HttpRequestBase>();
var response = new Mock<HttpResponseBase>();
var session = new Mock<HttpSessionStateBase>();
var server = new Mock<HttpServerUtilityBase>();
context.Setup(ctx => ctx.Request).Returns(request.Object);
context.Setup(ctx => ctx.Response).Returns(response.Object);
context.Setup(ctx => ctx.Session).Returns(session.Object);
context.Setup(ctx => ctx.Server).Returns(server.Object);
return context.Object;
}