public String RenderBasketOnceResolved(IBasket basket)
        {
            var resolver = new RenderBasket_IBasketResolver(this);

            basket.Accept(resolver);
            return(resolver.Result);
        }
예제 #2
0
        protected Decimal?TryGetTotalByBasketOnceResolved(IBasket basket, String benchmarkId, BenchmarkRepository benchmarkRepository)
        {
            var resolver = new TryGetTotalByBasket_IBasketResolver(this, benchmarkRepository, benchmarkId);

            basket.Accept(resolver);
            return(resolver.Result);
        }
예제 #3
0
        public static CountryBasket TryAsCountryBasket(this IBasket basket)
        {
            var resolver = new TryAs_IBasketResolver();

            basket.Accept(resolver);
            return(resolver.CountryBasketOpt);
        }
예제 #4
0
        public static RegionBasket TryAsRegionBasket(this IBasket basket)
        {
            var resolver = new TryAs_IBasketResolver();

            basket.Accept(resolver);
            return(resolver.RegionBasketOpt);
        }
예제 #5
0
        public Boolean IsSecurityFromBasketOnceResolved(ISecurity security, IBasket basket)
        {
            var resolver = new IsSecurityFromBasket_IBasketResolver(this, security);

            basket.Accept(resolver);
            return(resolver.Result);
        }
예제 #6
0
        public BasketModel SerializeBasketOnceResolved(IBasket model)
        {
            var resolver = new SerializeBasketOnceResolved_IBasketResolver(this);

            model.Accept(resolver);
            return(resolver.Result);
        }
예제 #7
0
        public void ShippableProductVisitor_Returns_Only_Shippable_Products()
        {
            //// Arrange
            const int expected = 4;
            var       visitor  = new ShippableProductVisitor();

            //// Act
            _basket.Accept(visitor);

            //// Assert
            Assert.AreEqual(expected, visitor.ShippableItems.Count());
        }
예제 #8
0
        public void ShippableProductVisitor_Returns_Only_Shippable_Products()
        {
            //// Arrange
            var notShippable = PreTestDataWorker.MakeExistingProduct(false);

            _basket.AddItem(notShippable);

            const int expected = 4;
            var       visitor  = new ShippableProductVisitor();

            //// Act
            _basket.Accept(visitor);

            //// Assert
            Assert.AreEqual(expected, visitor.ShippableItems.Count());
        }