Exemple #1
0
        public Task Handle(ProductRemovedEvent message)
        {
            if (message == null)
            {
                throw new ArgumentNullException(nameof(message));
            }

            var notifier = _connectionManager.GetHubContext <Notifier>();

            notifier.Clients.All.productRemoved(_responseBuilder.GetProductRemovedEvent(message));
            return(Task.FromResult(0));
        }
Exemple #2
0
        public void AndCartContainsAnotherProduct_ThenProductShouldNotBeRemoved()
        {
            Product milk      = Create.Product().Milk();
            Product meatBalls = Create.Product().MeatBalls();
            Cart    cart      = Create.Cart().WithProduct(milk).Please();

            ProductRemovedEvent productRemovedEvent = new ProductRemovedEvent(meatBalls);

            cart.Apply(productRemovedEvent);

            Assert.AreEqual(1, cart.Products.Count);
            Assert.AreEqual(milk, cart.Products[0]);
        }
        public void AndCartContainsOneProduct_ThenProductShouldBeRemovedFromCart()
        {
            Product milk = Create.Product().Milk();
            Cart    cart = Create.Cart()
                           .WithProduct(milk)
                           .Please();

            Assert.AreEqual(cart.Products.Count, 1);
            ProductRemovedEvent productRemovedEvent = new ProductRemovedEvent(milk);

            cart.Apply(productRemovedEvent);

            Assert.AreEqual(0, cart.Products.Count);
        }
Exemple #4
0
 public Task Handle(ProductRemovedEvent message, CancellationToken cancellationToken)
 {
     return(Task.CompletedTask);
 }
 public void Handle(ProductRemovedEvent notification)
 {
     var response = _elasticClient.Delete <ProductRemovedEvent>(notification.Id, d => d
                                                                .Index("alias-product")
                                                                .Type("product"));
 }
 public void Handle(ProductRemovedEvent message)
 {
     // Send some see you soon e-mail
 }
 public Task Handle(ProductRemovedEvent notification, CancellationToken cancellationToken)
 {
     return(Task.CompletedTask);
 }
Exemple #8
0
        public Task Handle(ProductRemovedEvent message, CancellationToken cancellationToken)
        {
            // Send some see you soon e-mail

            return(Task.CompletedTask);
        }