public void SetUpSessionStateUsesSessionStateValueFromRequestingPageIfAvailable()
        {
            // Arrange
            var page = new DisabledSessionWebPage();
            var webPageHttpHandler = new WebPageHttpHandler(page, startPage: null);
            var context = new Mock<HttpContextBase>(MockBehavior.Strict);
            context.Setup(c => c.SetSessionStateBehavior(SessionStateBehavior.Disabled)).Verifiable();

            // Act
            SessionStateUtil.SetUpSessionState(context.Object, webPageHttpHandler, new ConcurrentDictionary<Type, SessionStateBehavior?>());

            // Assert
            context.Verify();
        }
示例#2
0
        public void SetUpSessionStateUsesSessionStateValueFromRequestingPageIfAvailable()
        {
            // Arrange
            var page = new DisabledSessionWebPage();
            var webPageHttpHandler = new WebPageHttpHandler(page, startPage: null);
            var context            = new Mock <HttpContextBase>(MockBehavior.Strict);

            context.Setup(c => c.SetSessionStateBehavior(SessionStateBehavior.Disabled)).Verifiable();

            // Act
            SessionStateUtil.SetUpSessionState(context.Object, webPageHttpHandler, new ConcurrentDictionary <Type, SessionStateBehavior?>());

            // Assert
            context.Verify();
        }