Exemplo n.º 1
0
        public void ReturnStoredData()
        {
            var model = new EnvironmentModel();

            var httpBaseMock = new Mock<HttpContextBase>();
            httpBaseMock.Setup(c => c.Application["Glimpse.AspNet.Environment"]).Returns(model);

            var contextMock = new Mock<ITabContext>();
            contextMock.Setup(c => c.GetRequestContext<HttpContextBase>()).Returns(httpBaseMock.Object);

            var request = new Glimpse.AspNet.Tab.Environment();
            var result = request.GetData(contextMock.Object);
             
            Assert.Same(model, result);
        }
Exemplo n.º 2
0
        public void ReturnStoredData()
        {
            var model = new EnvironmentModel();

            var httpBaseMock = new Mock <HttpContextBase>();

            httpBaseMock.Setup(c => c.Application["Glimpse.AspNet.Environment"]).Returns(model);

            var contextMock = new Mock <ITabContext>();

            contextMock.Setup(c => c.GetRequestContext <HttpContextBase>()).Returns(httpBaseMock.Object);

            var request = new Glimpse.AspNet.Tab.Environment();
            var result  = request.GetData(contextMock.Object);

            Assert.Same(model, result);
        }
Exemplo n.º 3
0
        public void HaveADocumentationUri()
        {
            var request = new Glimpse.AspNet.Tab.Environment();

            Assert.False(string.IsNullOrWhiteSpace(request.DocumentationUri));
        }
Exemplo n.º 4
0
 public void BeNamedEnvironment()
 {
     var request = new Glimpse.AspNet.Tab.Environment();
     Assert.Equal("Environment", request.Name);
 }
Exemplo n.º 5
0
 public void UseDefaultLifeCycleSupport()
 {
     var request = new Glimpse.AspNet.Tab.Environment();
     Assert.Equal(RuntimeEvent.EndRequest, request.ExecuteOn);
 }
Exemplo n.º 6
0
        public void HaveProperContextObjectType()
        {
            var request = new Glimpse.AspNet.Tab.Environment();

            Assert.Equal(typeof(HttpContextBase), request.RequestContextType);
        }
Exemplo n.º 7
0
        public void HaveADocumentationUri()
        {
            var request = new Glimpse.AspNet.Tab.Environment();

            Assert.False(string.IsNullOrWhiteSpace(request.DocumentationUri));
        }
Exemplo n.º 8
0
        public void BeNamedEnvironment()
        {
            var request = new Glimpse.AspNet.Tab.Environment();

            Assert.Equal("Environment", request.Name);
        }
Exemplo n.º 9
0
        public void UseDefaultLifeCycleSupport()
        {
            var request = new Glimpse.AspNet.Tab.Environment();

            Assert.Equal(RuntimeEvent.EndRequest, request.ExecuteOn);
        }
Exemplo n.º 10
0
        public void HaveProperContextObjectType()
        {
            var request = new Glimpse.AspNet.Tab.Environment();

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