public Task Handle(NameDirector command, Guid commandId) { command.DirectorId = Guid.NewGuid(); var director = new Director(command.DirectorId, command.Name); return(_repository.Save(director, commandId)); }
public async Task Create_movie_on_TitleMovie_command() { var repository = new DummyRepository <Director>(); var handler = new DirectorHandlers(repository); var command = new NameDirector { DirectorId = Guid.NewGuid(), Name = "Some Guy" }; await handler.Handle(command, Guid.NewGuid()); repository.Items.Count.Should().Be(1); }