public async Task throws_when_command_aggregate_has_empty_id(DeleteCalendarItemCycleCommand command) { command.AggregateId = Guid.Empty; var exception = await Record.ExceptionAsync(() => act(command)); exception.ShouldBeOfType(typeof(AwesomeCalendarException)); Assert.Equal(((AwesomeCalendarException)exception).Type, AwesomeCalendarExceptionType.InvalidCommand); }
async Task act(DeleteCalendarItemCycleCommand command) { await DeleteCommandHandler.HandleAsync(command); }