< Summary

Information
Class: Services.DataServices.DeliveryDataServices
Assembly: Services
File(s): /home/runner/work/Studio2Prod/Studio2Prod/AppRepository/DataServices/DeliveryDataServices.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 11
Coverable lines: 11
Total lines: 35
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 2
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%210%
GetOrCreateDeliveryAsync()0%620%
GetDeliveriesAsync()100%210%
GetDeliveryAsync()100%210%
GetProviders()100%210%

File(s)

/home/runner/work/Studio2Prod/Studio2Prod/AppRepository/DataServices/DeliveryDataServices.cs

#LineLine coverage
 1using OzonDomains;
 2using OzonDomains.Models;
 3using OzonRepositories.Data;
 4
 5namespace Services.DataServices;
 6
 7public class DeliveryDataServices
 8{
 9    private readonly DeliveryRepository _repository;
 10
 011    public DeliveryDataServices(DeliveryRepository repository)
 12    {
 013        _repository = repository;
 014    }
 15
 16    public async Task<Delivery> GetOrCreateDeliveryAsync(string name, string? provider = null)
 17    {
 018        return await _repository.GetOrCreateDeliveryAsync(name, provider ?? "");
 019    }
 20
 21    public async Task<List<Delivery>> GetDeliveriesAsync()
 22    {
 023        return await _repository.GetAllAsync();
 024    }
 25
 26    public async Task<Delivery?> GetDeliveryAsync(int id)
 27    {
 028        return await _repository.GetByIdAsync(id);
 029    }
 30
 31    public async Task<List<DeliveryProvider>> GetProviders()
 32    {
 033        return await _repository.GetAllProvider();
 034    }
 35}