public void WhenActiveCartWithOneItemAndAddItemExpectActiveCartWithTwoItems()
        {
            var activeCart1 = new CartStateActive(new[] { Product.ProductY });

            var newState = activeCart1.Add(Product.ProductX);

            var isActiveState = newState.Func(cartStateEmpty => false, cartStateActive => true, cartStatePaid => false);
            Assert.IsTrue(isActiveState);

            var itemCount = newState.Func(cartStateEmpty => -1, cartStateActive => cartStateActive.Items.Count(), cartStatePaid => -1);
            Assert.That(itemCount, Is.EqualTo(2));
        }
        public void WhenActiveCartWithOneItemAndAddItemExpectActiveCartWithTwoItems()
        {
            // arrange
            var activeCart1 = new CartStateActive(new[] { Product.ProductY });

            // act
            var newState = activeCart1.Add(Product.ProductX);

            // assert
            var activeState = newState as CartStateActive; //CAST!
            if (activeState != null)
            {
                var itemCount = activeState.Items.Count();
                Assert.That(itemCount, Is.EqualTo(2));
            }
            else
            {
                Assert.Fail("Expect CartStateActive");
            }
        }