public Spending GetById(long id) { if (id < 1) { throw new NotFoundException(); } Spending spending = _repositorySpending.GetById(id) ?? throw new NotFoundException(); return(spending); }
public void GetById_Test() { item.Id = 1; item.Description = "bla bla"; item.SpendingDate = DateTime.Now; item.MoneySpent = 5; spendingRepo.GetById(item.Id); Assert.IsNotNull(item); }