コード例 #1
0
        public async Task RegisterUserToAccount_WhenAccountDoesntExist_ThrowsException()
        {
            Repository   = new Mock <IAccountRepository>();
            Orchestrator = new AccountOrchestrator(Repository.Object);

            await Assert.ThrowsAsync <AccountNotFoundException>(
                async() => await Orchestrator.RegisterUserToAccount(Account.Id, Guid.NewGuid()));
        }
コード例 #2
0
        public async Task RegisterUserToAccount_WhenUserLimitReached_ThrowsException()
        {
            var account = GetStartupAccountWithNumberOfUsers(new StartupPlan().MaxNumberOfUsersAllowed);

            Repository   = GetRepositoryMock(account);
            Orchestrator = new AccountOrchestrator(Repository.Object);

            await Assert.ThrowsAsync <UserLimitExceededException>(
                async() => await Orchestrator.RegisterUserToAccount(account.Id, UserId));
        }
コード例 #3
0
 public async Task RegisterUser(Guid accountId, Guid userId)
 {
     await Orchestrator.RegisterUserToAccount(accountId, userId);
 }
コード例 #4
0
 public async Task RegisterUserToAccount_WhenUserAlreadyExistsOnAccount_ThrowsException()
 {
     await Assert.ThrowsAsync <DuplicateUserOnAccountException>(
         async() => await Orchestrator.RegisterUserToAccount(Account.Id, UserId));
 }