public void Handler_Should_Be_Invalid_When_Email_Is_NotEmail()
        {
            var repAcommodation = new AcommodationRepository();
            var repFurniture    = new FurnitureRepository();
            var payService      = new PaymentService();

            var handler = new FurnitureReservationHandler(repFurniture, repAcommodation, payService);

            var user      = new User("Matheus barbosa", "notemail", new Adress("Rua x", "123", "SÃO PAULO"));
            var furniture = new Furniture("Descriçao", new Adress("Rua y", "321", "SÃO PAULO"));

            var payment = new Payment(500, 500);

            var commandRequest = new FurnitureReservationRequest()
            {
                User = user, Furniture = furniture, Payment = payment, Checkin = DateTime.Now, Checkout = DateTime.Now.AddDays(3)
            };
            var res = handler.Handle(commandRequest, new System.Threading.CancellationToken());

            Assert.True(handler.Contract.Invalid);
        }
        public void Debugger_Test_for_see_notifications()
        {
            var repAcommodation = new AcommodationRepository();
            var repFurniture    = new FurnitureRepository();

            var payService = new PaymentService();

            var handler = new FurnitureReservationHandler(repFurniture, repAcommodation, payService);

            var user      = new User("", "*****@*****.**", new Adress("Rua x", "123", "SÃO PAULO"));
            var furniture = new Furniture("", new Adress("Rua y", "321", "SÃO PAULO"));

            var payment = new Payment(500, 200);

            var commandRequest = new FurnitureReservationRequest()
            {
                User = user, Furniture = furniture, Payment = payment, Checkin = DateTime.Now, Checkout = DateTime.Now.AddDays(3)
            };
            var res = handler.Handle(commandRequest, new System.Threading.CancellationToken());

            Assert.True(handler.Contract.Invalid);
        }
        public void Handler_Should_Be_Invalid_When_Payment_Is_Invalid()
        {
            var repAcommodation = new AcommodationRepository();
            var repFurniture    = new FurnitureRepository();
            var payService      = new PaymentService();

            payService.throwException = true;

            var handler = new FurnitureReservationHandler(repFurniture, repAcommodation, payService);

            var user      = new User("", "*****@*****.**", new Adress("Rua x", "123", "SÃO PAULO"));
            var furniture = new Furniture("", new Adress("Rua y", "321", "SÃO PAULO"));
            var payment   = new Payment(500, 200);

            var commandRequest = new FurnitureReservationRequest()
            {
                User = user, Furniture = furniture, Payment = payment, Checkin = DateTime.Now, Checkout = DateTime.Now.AddDays(3)
            };
            var res = handler.Handle(commandRequest, new System.Threading.CancellationToken());

            Assert.True(handler.Contract.Invalid && res.Result.Errors.Count == 3);
        }