Esempio n. 1
0
        //TODO mock the session to get the cart
        public void FromSession_ShouldGetTheCartFromSession()
        {
            //Arrange
            var sessionItems = new SessionStateItemCollection();

            sessionItems.Dirty   = false;
            sessionItems["cart"] = new ShoppingCart();

            var fakeHttpContext = FakeFactory.FakeHttpContextWithSession(sessionItems);

            var shoppingCartWrapper = new ShoppingCartWrapper(fakeHttpContext);

            //Act
            var shoppingCart = shoppingCartWrapper.Get();

            //Assert
            shoppingCart.Should().NotBeNull();
        }