< Summary

Information
Class: Api.Commands.GetTitleCaseCommand
Assembly: Api
File(s): /__w/production-ready-pipelines/production-ready-pipelines/Api/Commands/GetTitleCaseCommand.cs
Line coverage
100%
Covered lines: 9
Uncovered lines: 0
Coverable lines: 9
Total lines: 21
Line coverage: 100%
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 Cyclomatic complexity Line coverage
.ctor(...)100%1100%
Execute(...)100%1100%

File(s)

/__w/production-ready-pipelines/production-ready-pipelines/Api/Commands/GetTitleCaseCommand.cs

#LineLine coverage
 1using System.Globalization;
 2using Common.Logging;
 3
 4namespace Api.Commands;
 5
 6public class GetTitleCaseCommand
 7{
 8    private readonly ILogger<GetTitleCaseCommand> _logger;
 9
 110    public GetTitleCaseCommand(ILogger<GetTitleCaseCommand> logger)
 111    {
 112        _logger = logger;
 113    }
 14
 15    public virtual string Execute(string text)
 116    {
 117        string titleCase = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(text);
 118        _logger.Information("Converted {text} to {titleCase}", text, titleCase);
 119        return titleCase;
 120    }
 21}