public void Remove_ExistingGuidPassed_ReturnsOkResult()
        {
            var    cartID          = "9b3df90a-1007-4778-b614-91df990e0c95";
            string id              = "e3656e5b-23df-4ced-a7e4-4b066839f54a";
            var    mockHttpContext = MockHttpSession.setSessionKey(cartID);

            _controller.ControllerContext.HttpContext = mockHttpContext.Object;
            // Act
            var okResponse = _controller.DeleteItemFromSC(id);

            // Assert
            Assert.IsType <OkResult>(okResponse);
        }
        public void Get_WhenCalled_ReturnsAllItems()
        {
            var cartID          = "9b3df90a-1007-4778-b614-91df990e0c95";
            var mockHttpContext = MockHttpSession.setSessionKey(cartID);

            _controller.ControllerContext.HttpContext = mockHttpContext.Object;
            // Act
            var okResult = _controller.Get().Result;
            // Assert
            var items = Assert.IsType <List <ShoppingCartDto> >(okResult.Value);

            Assert.Equal(3, items.Count);
        }
        public void Get_WhenCalled_ReturnsOkResult()
        {
            var cartID          = "9b3df90a-1007-4778-b614-91df990e0c95";
            var mockHttpContext = MockHttpSession.setSessionKey(cartID);

            _controller.ControllerContext.HttpContext = mockHttpContext.Object;

            // Act
            var okResult = _controller.Get();


            // Assert
            Assert.IsType <OkObjectResult>(okResult.Result);
        }
        public void Clear_ExistingGuidPassed()
        {
            var cartID          = "9b3df90a-1007-4778-b614-91df990e0c95";
            var mockHttpContext = MockHttpSession.setSessionKey(cartID);

            _controller.ControllerContext.HttpContext = mockHttpContext.Object;
            // Act
            _controller.ClearCart();
            var okResult = _controller.Get();
            var items    = Assert.IsType <List <ShoppingCartItemDto> >(okResult.Result);

            // Assert
            Assert.Empty(items);
        }
        public void AddToCart_ExistingGuidPassed()
        {
            var    cartID = "17b37a88-c502-45a8-84be-b48ecc205a3e";
            string id     = "e3656e5b-23df-4ced-a7e4-4b066839f54a";

            var mockHttpContext = MockHttpSession.setSessionKey(cartID);

            _controller.ControllerContext.HttpContext = mockHttpContext.Object;
            // Act
            _controller.AddtoCart(id, 1);
            var okResult = _controller.Get();
            var items    = Assert.IsType <List <ShoppingCartItemDto> >(okResult.Result);

            // Assert
            Assert.Equal(2, items.Count);
        }