示例#1
0
 public void SetUp()
 {
     logger = Substitute.For<Logger>();
     shoppingConsole = Substitute.For<ShoppingConsole>();
     shoppingCartViewModel = new ShoppingCartViewModel(logger);
     shoppingCart = new ShoppingCart(shoppingCartViewModel, shoppingConsole);
 }
示例#2
0
        static void Main(string[] args)
        {
            var viewModel = new ShoppingCartViewModel(new Logger());
            var shoppingCart = new ShoppingCart(viewModel, new ShoppingConsole());

            viewModel.AddProduct(new Product("SmartPhone"));
            viewModel.AddProduct(new Product("Computer"));
            viewModel.AddProduct(new Product("HeadPhones"));
            viewModel.AddProduct(new Product("Keyboard"));
            viewModel.AddProduct(new Product("Screen"));
        }