コード例 #1
0
        public Spending GetById(long id)
        {
            if (id < 1)
            {
                throw new NotFoundException();
            }

            Spending spending = _repositorySpending.GetById(id) ?? throw new NotFoundException();

            return(spending);
        }
コード例 #2
0
        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);
        }