< Summary

Class:ApplicationCore.Analytics.TextAnalyticsClientFactory
Assembly:ApplicationCore
File(s):C:\Users\Teknikaali\Source\Repos\jekyll-blog-comments\ApplicationCore\Analytics\TextAnalyticsClientFactory.cs
Covered lines:11
Uncovered lines:0
Coverable lines:11
Total lines:23
Line coverage:100% (11 of 11)
Covered branches:0
Total branches:0

Coverage History

Metrics

MethodCyclomatic complexity NPath complexity Sequence coverage Branch coverage
.ctor(...)10100%100%
CreateClient(...)10100%100%

File(s)

C:\Users\Teknikaali\Source\Repos\jekyll-blog-comments\ApplicationCore\Analytics\TextAnalyticsClientFactory.cs

#LineLine coverage
 1using Microsoft.Azure.CognitiveServices.Language.TextAnalytics;
 2
 3namespace ApplicationCore.Analytics
 4{
 5    public class TextAnalyticsClientFactory : ITextAnalyticsClientFactory
 6    {
 7        private readonly ICredentialsFactory _credentialsFactory;
 8
 39        public TextAnalyticsClientFactory(ICredentialsFactory credentialsFactory)
 310        {
 311            _credentialsFactory = credentialsFactory;
 312        }
 13
 14        public ITextAnalyticsClient CreateClient(string subscriptionKey, string region)
 115        {
 116            return new TextAnalyticsClient(
 117                _credentialsFactory.CreateApiKeyServiceCredentials(subscriptionKey))
 118            {
 119                Endpoint = $"https://{region}.api.cognitive.microsoft.com"
 120            };
 121        }
 22    }
 23}