コード例 #1
0
ファイル: RateTest.cs プロジェクト: Bukarachka/workaround
        public void TestDelete()
        {
            var entity = new Rate();

            entity.Id = "testId";

            _repository.Create(entity);

            _repository.Delete(entity.Id);

            Assert.Null(_repository.GetById(entity.Id));
        }
コード例 #2
0
        public GeneralResponse DeleteRate(Rate rate)
        {
            if (rate == null)
            {
                throw new ApplicationException("Rate was not provided");
            }

            var idResponse = GetByID(rate.ID);

            if (idResponse.Result == null)
            {
                throw new ApplicationException("Rate with ID " + rate.ID + " does not exists!");
            }

            _repo.Delete(rate);

            return(new GeneralResponse());
        }