Esempio n. 1
0
        public void ReturnData()
        {
            var serverMock = new Mock<HttpServerUtilityBase>();
            var requestMock = new Mock<HttpRequestBase>();
            requestMock.Setup(r => r.Cookies).Returns(new HttpCookieCollection());
            var httpBaseMock = new Mock<HttpContextBase>();
            httpBaseMock.Setup(c => c.Request).Returns(requestMock.Object);
            httpBaseMock.Setup(c => c.Server).Returns(serverMock.Object);
            var contextMock = new Mock<ITabContext>();
            contextMock.Setup(c => c.GetRequestContext<HttpContextBase>()).Returns(httpBaseMock.Object);

            var request = new Request();
            var result = request.GetData(contextMock.Object);

            Assert.NotNull(result);
            Assert.NotNull(result as RequestModel);
        }
Esempio n. 2
0
        public void HaveADocumentationUri()
        {
            var request = new Request();

            Assert.False(string.IsNullOrWhiteSpace(request.DocumentationUri));
        }
Esempio n. 3
0
 public void UseDefaultLifeCycleSupport()
 {
     var request = new Request();
     Assert.Equal(RuntimeEvent.EndRequest, request.ExecuteOn);
 }
Esempio n. 4
0
 public void BeNamedRequest()
 {
     var request = new Request();
     Assert.Equal("Request", request.Name);
 }
Esempio n. 5
0
        public void HaveProperContextObjectType()
        {
            var request = new Request();

            Assert.Equal(typeof(HttpContextBase), request.RequestContextType);
        }