public void ShouldRequireMinimumFields()
        {
            var command = new CreateJogoCommand();

            FluentActions.Invoking(() =>
                                   SendAsync(command)).Should().Throw <ValidationException>();
        }
        public async Task ShouldCreateJogo()
        {
            var userId = await RunAsDefaultUserAsync();

            var command = new CreateJogoCommand
            {
                Nome = "River Raid"
            };

            var id = await SendAsync(command);

            var amigo = await FindAsync <Jogo>(id);

            amigo.Should().NotBeNull();
            amigo.Nome.Should().Be(command.Nome);
            amigo.CreatedBy.Should().Be(userId);
            amigo.Created.Should().BeCloseTo(DateTime.Now, 10000);
        }
Example #3
0
 public async Task <ActionResult <int> > Create(CreateJogoCommand command)
 {
     return(await Mediator.Send(command));
 }