public override async Task <ServiceResult <IEnumerable <PriceTresholdBaseDto> > > GetAllAsync() { var count = Count(); if (count.Result == 0) { _repository.Add(new PriceTreshold { MinCharges = 0, PricePerCharge = 3 }); await _unitOfWork.CommitAsync(); } return(ServiceResult <IEnumerable <PriceTresholdBaseDto> > .Success(_repository.GetAll(x => !x.IsDeleted).OrderBy(x => x.MinCharges).Select(_mapper.Map <PriceTresholdBaseDto>))); }
public void AddEntity_ThenResultIsValid() { //Before var preResult = _repository.GetAll().ToList(); //Act _repository.Add(GetPriceTreshold()); _uow.Commit(); var result = _repository.GetAll().ToList(); //Then result.Count.Should().Be.EqualTo(preResult.Count + 1); }