public void GolfClubCommandHandler_HandleCommand_AddTournamentDivisionToGolfClubCommand_CommandHandled() { Mock <IAggregateRepository <GolfClubAggregate> > repository = new Mock <IAggregateRepository <GolfClubAggregate> >(); repository.Setup(r => r.GetLatestVersion(It.IsAny <Guid>(), CancellationToken.None)).ReturnsAsync(GolfClubTestData.GetCreatedGolfClubAggregate); Mock <ISecurityService> oAuth2SecurityService = new Mock <ISecurityService>(); oAuth2SecurityService .Setup(o => o.RegisterUser(It.IsAny <RegisterUserRequest>(), CancellationToken.None)) .ReturnsAsync(GolfClubTestData.GetRegisterUserResponse()); Mock <IGolfClubMembershipApplicationService> golfClubMembershipApplicationService = new Mock <IGolfClubMembershipApplicationService>(); GolfClubCommandHandler handler = new GolfClubCommandHandler(repository.Object, oAuth2SecurityService.Object, golfClubMembershipApplicationService.Object); AddTournamentDivisionToGolfClubCommand command = GolfClubTestData.GetAddTournamentDivisionToGolfClubCommand(); Should.NotThrow(async() => { await handler.Handle(command, CancellationToken.None); }); }