Exemplo n.º 1
0
        public void DeveRetornarErroQuandoDocumentoExiste()
        {
            var handler = new AssinaturaHandler(new FakeAlunoRepository(), new FakeEmailService());
            var command = new CriarBoletoAssinaturaCommand();

            command.PrimeiroNome        = "Bruce";
            command.SegundoNome         = "Wayne";
            command.Documento           = "99999999999";
            command.Email               = "[email protected]";
            command.CodigoBarra         = "123456789";
            command.BoletoNumero        = "1234654987";
            command.PagamentoNumero     = "123121";
            command.DataPagamento       = DateTime.Now;
            command.DataExpiracao       = DateTime.Now.AddMonths(1);
            command.Total               = 60;
            command.TotalPago           = 60;
            command.Proprietario        = "WAYNE CORP";
            command.DocumentoDonoCartao = "12345678911";
            command.TipoDocumentoCartao = EDocumentoTipo.CPF;
            command.EmailDonoCartao     = "*****@*****.**";
            command.Rua    = "asdas";
            command.Numero = "asdd";
            command.Bairro = "asdasd";
            command.Cidade = "as";
            command.Estado = "as";
            command.Pais   = "as";
            command.Cep    = "12345678";

            handler.Handle(command);

            Assert.AreEqual(false, handler.Valid);
        }
        public void DeveRetornarErroQuandoNomeEInvalido()
        {
            var command = new CriarBoletoAssinaturaCommand();

            command.PrimeiroNome = "";

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