< Summary

Information
Class: ClientManager.API.Services.ClientService
Assembly: ClientManager.API
File(s): /home/runner/work/ClientManagerDemo/ClientManagerDemo/src/ClientManager/ClientManager.API/Services/ClientService.cs
Line coverage
66%
Covered lines: 6
Uncovered lines: 3
Coverable lines: 9
Total lines: 32
Line coverage: 66.6%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%
SendCreateClientMessage()100%1160%
GetClientById(...)100%210%

File(s)

/home/runner/work/ClientManagerDemo/ClientManagerDemo/src/ClientManager/ClientManager.API/Services/ClientService.cs

#LineLine coverage
 1using ClientManager.Shared.Contracts.Commands;
 2using ClientManager.Shared.Data;
 3using ClientManager.Shared.Messaging;
 4using ClientManager.Shared.Models;
 5using RabbitMQ.Client.Exceptions;
 6
 7namespace ClientManager.API.Services;
 8
 39public class ClientService(IMessagePublisher publisher, ReadOnlyAppDbContext readOnlyAppDbContext) : IClientService
 10{
 311    readonly IMessagePublisher _messagePublisher = publisher;
 12
 313    readonly ReadOnlyAppDbContext _readOnlyAppDbContext = readOnlyAppDbContext;
 14
 15    public async Task<CreateClient> SendCreateClientMessage(CreateClient message)
 16    {
 17        try
 18        {
 519            await _messagePublisher.PublishAsync(message);
 420            return message;
 21        }
 022        catch (PublishException)
 23        {
 024            throw;
 25        }
 426    }
 27
 28    public Task<Client> GetClientById(Guid id)
 29    {
 030        throw new NotImplementedException();
 31    }
 32}