Inheritance: Admin.ReadModels.Client.IProductsView
Example #1
0
        public void Should_succeed_when_starting_a_new_order_with_a_valid_product_and_quantity()
        {
            var id = Guid.NewGuid();
            var adminProducts = new FakeAdminProductView();
            var productId = adminProducts.GetProducts().First().Id;

            var command = new StartNewOrder(id, productId, 1);
            var handler = new OrderCommandHandlers(repository, adminProducts);
            handler.Handle(command);

            var order = repository.GetById<Order>(id);
            Assert.Equal(1, order.Quantity);
        }
        public void Should_succeed_when_starting_a_new_order_with_a_valid_product_and_quantity()
        {
            var id            = Guid.NewGuid();
            var adminProducts = new FakeAdminProductView();
            var productId     = adminProducts.GetProducts().First().Id;

            var command = new StartNewOrder(id, productId, 1);
            var handler = new OrderCommandHandlers(repository, adminProducts);

            handler.Handle(command);

            var order = repository.GetById <Order>(id);

            Assert.Equal(1, order.Quantity);
        }