Exemplo n.º 1
0
        static void Main(string[] args)
        {
            var mediator = CompositionRoot.Get <IMediator>();

            var getCustomerQuery = new GetCustomerById.Query {
                Id = Guid.Parse("E4931718-A149-4C17-8545-5D36D81A6DD5")
            };

            var customer = mediator.Send(getCustomerQuery).Result;
        }
        public void Negative_Id()
        {
            var query = new GetCustomerById.Query
            {
                Id = -3
            };

            var customer = Mediator.Send(query).GetAwaiter().GetResult();

            Assert.IsNull(customer);
        }
        public void Valid_Id()
        {
            var query = new GetCustomerById.Query
            {
                Id = 1
            };

            var customer = Mediator.Send(query).GetAwaiter().GetResult();

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