public void Valid_Customer()
        {
            var customer = QueryRepository.GetById(1);

            Assert.IsNotNull(customer);
            Assert.AreEqual("Melissa", customer.FirstName);
            Assert.AreEqual("Labadie", customer.LastName);
            Assert.AreEqual(true, customer.IsActive);

            var command = new SetCustomerInactive.Command
            {
                Customer = customer
            };

            Mediator.Send(command).Wait();

            var modifiedCustomer = QueryRepository.GetById(1);

            Assert.IsNotNull(modifiedCustomer);
            Assert.AreEqual("Melissa", modifiedCustomer.FirstName);
            Assert.AreEqual("Labadie", modifiedCustomer.LastName);
            Assert.AreEqual(false, modifiedCustomer.IsActive);
        }
Exemple #2
0
        public void Valid_Customer()
        {
            var customer = QueryRepository.GetById(1);

            var command = new SetCustomerInactive.Command {
                Customer = customer
            };

            Mediator.Send(command).Wait();

            var @event = new CustomerWasUpdated.Event {
                Customer = customer
            };

            Mediator.Send(@event).Wait();
        }