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

            await Assert.ThrowsAsync <AccountNotFoundException>(
                async() => await Orchestrator.GetAccountBy(Account.Id));
        }
コード例 #2
0
        public async Task GetAccountBy__ReturnsAccount()
        {
            var account = await Orchestrator.GetAccountBy(Account.Id);

            Assert.Single(account.Users);
            Assert.Equal(Account.Id, account.Id);
            Assert.Equal(Plan.Enterprise, account.CurrentPlan);
        }
コード例 #3
0
        public async Task <IActionResult> Get(Guid id)
        {
            var retrievedAccount = await Orchestrator.GetAccountBy(id);

            return(Ok(retrievedAccount));
        }