Example #1
0
        public void End2End_KnownProductBarcode_WillResultIn_ProductPrice()
        {
            var knownBarcode            = new Barcode();
            var knownProductPriceResult = new KnownProductPriceResult();

            var cashRegisterProcessorRendererTestDouble = new CashRegisterRendererTestDouble();
            var productPriceProviderTestDouble          = new ProductCatalogTestDouble(knownProductPriceResult);
            var cashRegisterProcessor = new CashRegisterProcessor(productPriceProviderTestDouble, cashRegisterProcessorRendererTestDouble);

            cashRegisterProcessor.OnBarcode(knownBarcode);

            Assert.Equal(knownProductPriceResult, cashRegisterProcessorRendererTestDouble.ResultToRender);
        }
Example #2
0
        public void End2End_UnknownProductBarcode_WillResultIn_UnknownProduct()
        {
            //discuss because behaviour of result known/unknow and renderer ????
            // smell => internals are external visibile, implementation detail


            var unknownBarcode            = new Barcode();
            var unknownProductPriceResult = new UnknownProductPriceResult();

            var cashRegisterProcessorRendererTestDouble = new CashRegisterRendererTestDouble();
            var productPriceProviderTestDouble          = new ProductCatalogTestDouble(unknownProductPriceResult);
            var cashRegisterProcessor = new CashRegisterProcessor(productPriceProviderTestDouble, cashRegisterProcessorRendererTestDouble);

            cashRegisterProcessor.OnBarcode(unknownBarcode);

            Assert.Equal(unknownProductPriceResult, cashRegisterProcessorRendererTestDouble.ResultToRender);
        }