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()));
        }
        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));
        }
Ejemplo n.º 3
0
 public async Task RegisterUser(Guid accountId, Guid userId)
 {
     await Orchestrator.RegisterUserToAccount(accountId, userId);
 }
 public async Task RegisterUserToAccount_WhenUserAlreadyExistsOnAccount_ThrowsException()
 {
     await Assert.ThrowsAsync <DuplicateUserOnAccountException>(
         async() => await Orchestrator.RegisterUserToAccount(Account.Id, UserId));
 }