예제 #1
0
        public MyHttpContext(HttpContextTestData myTestData)
        {
            var request = new Mock <HttpRequestBase>();

            if (myTestData != null && !string.IsNullOrEmpty(myTestData.Url))
            {
                request.SetupGet(x => x.Url).Returns(new Uri(myTestData.Url));
            }
            _context.SetupGet(x => x.Request).Returns(request.Object);
        }
예제 #2
0
 public MyHttpContext(HttpContextTestData myTestData)
 {
     var request = new Mock<HttpRequestBase>();
     if (myTestData != null && !string.IsNullOrEmpty(myTestData.Url))
         request.SetupGet(x => x.Url).Returns(new Uri(myTestData.Url));
     _context.SetupGet(x => x.Request).Returns(request.Object);
 }