public void TournamentCommandHandler_HandleCommand_CancelTournamentCommand_WithScores_CommandHandled() { Mock <IAggregateRepository <GolfClubAggregate> > golfClubRepository = new Mock <IAggregateRepository <GolfClubAggregate> >(); Mock <IAggregateRepository <TournamentAggregate> > tournamentRepository = new Mock <IAggregateRepository <TournamentAggregate> >(); tournamentRepository.Setup(t => t.GetLatestVersion(It.IsAny <Guid>(), It.IsAny <CancellationToken>())) .ReturnsAsync(TournamentTestData.GetCreatedTournamentWithScoresRecordedAggregate); Mock <ITournamentApplicationService> tournamentApplicationService = new Mock <ITournamentApplicationService>(); TournamentCommandHandler handler = new TournamentCommandHandler(golfClubRepository.Object, tournamentRepository.Object, tournamentApplicationService.Object); CancelTournamentCommand command = TournamentTestData.GetCancelTournamentCommand(); Should.NotThrow(async() => { await handler.Handle(command, CancellationToken.None); }); }