Beispiel #1
0
        public void NotificacaoInconsistenciasNome()
        {
            //Arrange
            var handler = new IncluirContribuinteHandler(_uow, _notifications, _mediator, _contribuinteRepository);
            var command = new IncluirContribuinteCommand("448.028.616-05", string.Empty, 4, 7800);

            //Act
            handler.Handle(command, new CancellationToken(false));
            //Assert
            _mediator.ReceivedWithAnyArgs(2).Publish((INotification)null);
        }
Beispiel #2
0
        public void NotificacaoInconsistenciasRendaBrutaMensal()
        {
            //Arrange
            var handler = new IncluirContribuinteHandler(_uow, _notifications, _mediator, _contribuinteRepository);
            var command = new IncluirContribuinteCommand("448.028.616-05", "Diego Matheus Porto", 0, -165465);

            //Act
            handler.Handle(command, new CancellationToken(false));
            //Assert
            _mediator.ReceivedWithAnyArgs(1).Publish((INotification)null);
        }
Beispiel #3
0
        public void NotificacaoInconsistenciasCPF()
        {
            //Arrange
            var handler = new IncluirContribuinteHandler(_uow, _notifications, _mediator, _contribuinteRepository);
            var command = new IncluirContribuinteCommand(string.Empty, "Diego Matheus Porto", 1, 3600);

            //Act
            handler.Handle(command, new CancellationToken(false));
            //Assert
            _mediator.ReceivedWithAnyArgs(4).Publish((INotification)null);
        }
Beispiel #4
0
        public void ContribuinteAdicionado()
        {
            //Arrange
            var handler = new IncluirContribuinteHandler(_uow, _notifications, _mediator, _contribuinteRepository);
            var command = new IncluirContribuinteCommand("448.028.616-05", "Diego Matheus Porto", 2, 5968);

            _uow.Commit().Returns(true);
            //Act
            handler.Handle(command, new CancellationToken(false));
            //Assert
            _mediator.DidNotReceiveWithAnyArgs().Publish((INotification)null);
        }
Beispiel #5
0
        public void NotificacaoCpfJaCadastrado()
        {
            //Arrange
            var cpf = "448.028.616-05";

            _contribuinteRepository.IsCpfRegistered(cpf).Returns(true);
            var handler = new IncluirContribuinteHandler(_uow, _notifications, _mediator, _contribuinteRepository);
            var command = new IncluirContribuinteCommand(cpf, "Diego Matheus Porto", 2, 2335);

            //Act
            handler.Handle(command, new CancellationToken(false));
            //Assert
            _mediator.ReceivedWithAnyArgs(1).Publish((INotification)null);
        }