public async Task <ActionResult <DimAccount> > GetDimCustomerById(int id)
        {
            DimAccount customer = await _service.GetDimCustomerByIdAsync(id);

            if (customer == null)
            {
                return(NotFound());
            }

            return(customer);
        }
Beispiel #2
0
        public async Task GetDimCustomerByIdAsync_SomeIntNumber_DimAccountWithSomeIntKey()
        {
            _moqService.Setup(a => a.GetDimCustomerByIdAsync(It.IsAny <int>()))
            .ReturnsAsync((int x) => { return(new DimAccount()
                {
                    AccountKey = x
                }); });

            int someInt = 10;

            IDimAccountService _dimAccountService = _moqService.Object;

            DimAccount actualDimAccount = await _dimAccountService.GetDimCustomerByIdAsync(someInt);

            Assert.AreEqual(someInt, actualDimAccount.AccountKey);
        }