public async Task Test1() { //arrange var mock = new Mock <IUnitOfWork>(); mock.Setup(unitOfWork => unitOfWork.Accounts.GetAllByUserAsync(1)).Returns(GetTestAccount()); AccountService accountService = new AccountService( new AccountDataAccess(mock.Object), new CurrencyRateService(), new AccountMapper()); //act var account = await accountService.AccountStateAsync(new Dto.Requests.AccountStateRequest { UserId = 1 }); Assert.AreEqual(account.IsSuccess, true); Assert.AreEqual(account.Accounts.Count, 1); Assert.AreEqual(account.Accounts[0].Id, 1); Assert.AreEqual(account.Accounts[0].UserId, 1); Assert.AreEqual(account.Accounts[0].CurrencyId, 1); Assert.AreEqual(account.Accounts[0].Amount, 100); Assert.Pass(); }