public void GetAll_Test() { ICollection <Spending> spendings = new HashSet <Spending>(); spendings = spendingRepo.GetAll(); Assert.IsNotNull(spendings); Assert.AreEqual(spendings.Count, spendingRepo.GetAll().Count); }
public async Task <ActionResult <IEnumerable <Spending> > > GetSpendings() { var user = await _repository.ValidUser(GetTokenUserId()); if (user == null) { return(NotFound()); } var spendings = await _repository.GetAll(user.Id); if (spendings == null) { return(NotFound()); } return(Ok(spendings)); }
// GET: Spending public async Task <IActionResult> Index() { return(View(await _repository.GetAll())); }
public IQueryable <Spending> GetAll() { return(_repositorySpending.GetAll()); }