public void WhenLoadedFromCookie()
        {
            // Arrange
            IServiceLocator serviceLocator = Substitute.For <IServiceLocator>();

            // mock configuration
            MockConfiguration(serviceLocator);

            // mock request
            HttpContextBase httpContext    = Substitute.For <HttpContextBase>();
            var             requestWrapper = MockHttpRequestWithCookie();

            httpContext.Request.Returns(requestWrapper);

            // mock cookie data manager to send dummy webconnection info
            var webConnectionInfo = MockCookieDataManager(serviceLocator);

            IWebConnectionInfoProvider webConnectionInfoProvider = new WebConnectionInfoProvider(serviceLocator);

            // Act
            WebConnectionInfo result = webConnectionInfoProvider.TryLoad(httpContext);

            // Assert
            Assert.AreEqual(webConnectionInfo.UserAuthToken, result.UserAuthToken);
        }
        public void WhenCookieNotPresent()
        {
            // Arrange
            IServiceLocator serviceLocator = Substitute.For <IServiceLocator>();

            // mock configuration
            MockConfiguration(serviceLocator);

            // mock request
            HttpContextBase httpContext    = Substitute.For <HttpContextBase>();
            var             requestWrapper = MockHttpRequestWithCookie("Some");

            httpContext.Request.Returns(requestWrapper);

            IWebConnectionInfoProvider webConnectionInfoProvider = new WebConnectionInfoProvider(serviceLocator);

            // Act
            WebConnectionInfo result = webConnectionInfoProvider.TryLoad(httpContext);

            // Assert
            Assert.IsNull(result);
        }