Exemple #1
0
        public void ShouldReturnErrorDocumentExists()
        {
            var handler = new SubscriptionHandler(new FakeStudentRespository(), new FakeEmailService());
            var command = new CreateBoletoSubcriptionCommand();

            command.BarCode           = "1234567890123";
            command.FirstName         = "Bruce";
            command.LastName          = "Wayne";
            command.Document          = "12345678901";
            command.Email             = "*****@*****.**";
            command.BoletoNumber      = "1234567890";
            command.PaymentNumber     = "123123";
            command.PaidDate          = DateTime.Now;
            command.ExpireDate        = DateTime.Now.AddMonths(1);
            command.Total             = 60;
            command.TotalPaid         = 60;
            command.Payer             = "Wayne Corp";
            command.PayerDocument     = "12345678901";
            command.PayerDocumentType = EDocumentType.CPF;
            command.PayerEmail        = "*****@*****.**";
            command.Street            = "asd asd";
            command.Number            = "a sdaa sd";
            command.Neighborhood      = "a sda dasd";
            command.City    = "a sdad as";
            command.State   = "a sda d";
            command.Country = "a sdasd asd";
            command.ZipCode = "a sdasd asd ";

            handler.Handle(command);

            Assert.AreEqual(false, handler.Valid);
        }
Exemple #2
0
        public void ShouldReturnErrorWhenDocumentExists()
        {
            var handler = new SubscriptionHandler(new FakeStudentRepository(), new FakeEmailService());
            var command = new CreateBoletoSubcriptionCommand();

            command.FirstName          = "Danilo";
            command.LastName           = "Ferrari";
            command.Document           = "99999999999";
            command.Email              = "[email protected]";
            command.BarCode            = "123456789";
            command.BoletoNumber       = "1234654987";
            command.PaymentNumber      = "123121";
            command.PaidDate           = DateTime.Now;
            command.ExpireDate         = DateTime.Now.AddMonths(1);
            command.Total              = 60;
            command.TotalPaid          = 60;
            command.Payer              = "Dandan";
            command.PayerDocument      = "12345678911";
            command.PaymerDocumentType = EDocumentType.CNPJ;
            command.PayerEmail         = "*****@*****.**";
            command.Street             = "asdas";
            command.Number             = "asdd";
            command.Neighborhood       = "asdasd";
            command.City    = "as";
            command.State   = "as";
            command.Country = "as";
            command.ZipCode = "12345678";

            handler.Handle(command);
            Assert.AreEqual(false, handler.Valid);
        }
        public void ShouldReturnErrorWhenNameIsInvalid()
        {
            var command = new CreateBoletoSubcriptionCommand();

            command.FirstName = "";

            command.Validate();
            Assert.AreEqual(false, command.Valid);
        }