Beispiel #1
0
        public void SessionHasSessionId()
        {
            // Arrange

            // Act
            var sut = WebApplicationProxy.GetNewSession();

            // Assert
            Assert.False(string.IsNullOrEmpty(sut.SessionID));
        }
Beispiel #2
0
        public void SessionOnPageMatchesHttpContextCurrent()
        {
            // Arrange

            // Act
            var sut     = WebApplicationProxy.GetNewSession();
            var thePage = WebApplicationProxy.GetPageByLocation("/default.aspx", ctx => ctx.AddSession(sut)) as Page;

            // Assert
            Assert.Same(sut, thePage.Session);
            Assert.NotNull(HttpContext.Current);
        }
Beispiel #3
0
        public void CheckSessionExistsOnInjectedContextWithSessionOnWebService()
        {
            var session = WebApplicationProxy.GetNewSession(new Dictionary <string, object>
            {
                ["TestCode"] = "123"
            });

            var service = WebApplicationProxy.GetService <TestWebService>(context =>
            {
                context.AddSession(session);
            });

            Assert.Equal("123", service.Session["TestCode"]);
        }