public async Task GivenRegisterAsync_WhenEmptyEmail_ThenRaiseDomainNotification()
        {
            var registerUserViewModel = new RegisterUserViewModel()
            {
                Email    = "",
                Password = "******"
            };

            await _userAppService.RegisterAsync(registerUserViewModel);

            await _mediatorHandler
            .Received(1)
            .RaiseDomainNotificationAsync(Arg.Is <DomainNotification>(dm =>
                                                                      dm.Key == "RegisterUserCommand" && dm.Value == "Email required."));
        }
Exemple #2
0
        public async void Handle_WhenPayLoadCreated_ShouldRaisePayLoadCreatedEvent(PayLoadCreateCommand command)
        {
            var result = await _sut.Handle(command, new CancellationToken());

            result.Should().BeTrue();

            await _bus.Received(1).RaiseEvent(Arg.Is <PayLoadCreatedEvent>(p
                                                                           => p.EntityId != Guid.Empty &&
                                                                           p.CorrelationId == command.CorrelationId &&
                                                                           p.Content == command.Content &&
                                                                           p.Side == command.Side));
        }
 public void EntaoOClienteDeveSerCriado()
 {
     Assert.True(retorno);
     bus.Received().RaiseEvent(Arg.Any <ClienteCadastradoEvent>());
 }
Exemple #4
0
        public void Handle_WhenPayLoadCreated_ShouldSendAnalyzeDiffCommand(PayLoadCreatedEvent payLoadCreatedEvent)
        {
            _sut.Handle(payLoadCreatedEvent, new CancellationToken());

            _bus.Received(1).SendCommand(Arg.Is <AnalyzeDiffCommand>(a => a.CorrelationId == payLoadCreatedEvent.CorrelationId));
        }