public void GolfClubCommandHandler_HandleCommand_CreateMatchSecretaryCommand_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>(); Mock <IGolfClubMembershipApplicationService> golfClubMembershipApplicationService = new Mock <IGolfClubMembershipApplicationService>(); GolfClubCommandHandler handler = new GolfClubCommandHandler(repository.Object, oAuth2SecurityService.Object, golfClubMembershipApplicationService.Object); oAuth2SecurityService .Setup(o => o.RegisterUser(It.IsAny <RegisterUserRequest>(), CancellationToken.None)) .ReturnsAsync(GolfClubTestData.GetRegisterUserResponse()); CreateMatchSecretaryCommand command = GolfClubTestData.GetCreateMatchSecretaryCommand(); Should.NotThrow(async() => { await handler.Handle(command, CancellationToken.None); }); }