< Summary

Information
Class: Intentum.AI.SystemOne.SystemOneServiceCollectionExtensions
Assembly: Intentum.AI.SystemOne
File(s): /home/runner/work/Intentum/Intentum/src/Intentum.AI.SystemOne/SystemOneServiceCollectionExtensions.cs
Line coverage
100%
Covered lines: 7
Uncovered lines: 0
Coverable lines: 7
Total lines: 22
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 NPath complexity Sequence coverage
AddIntentumSystemOne(...)100%11100%

File(s)

/home/runner/work/Intentum/Intentum/src/Intentum.AI.SystemOne/SystemOneServiceCollectionExtensions.cs

#LineLine coverage
 1using Intentum.Core.Contracts;
 2using Microsoft.Extensions.DependencyInjection;
 3
 4namespace Intentum.AI.SystemOne;
 5
 6/// <summary>DI registration for the System One adapter.</summary>
 7public static class SystemOneServiceCollectionExtensions
 8{
 9    /// <summary>Registers <see cref="SystemOneIntentModel"/> as the <see cref="IIntentModel"/>.</summary>
 10    /// <param name="services">Service collection.</param>
 11    /// <param name="options">Engine options (BaseUrl, IntentCatalog, ...).</param>
 12    public static IServiceCollection AddIntentumSystemOne(this IServiceCollection services, SystemOneOptions options)
 113    {
 114        ArgumentNullException.ThrowIfNull(services);
 115        ArgumentNullException.ThrowIfNull(options);
 116        options.Validate();
 17
 218        services.AddSingleton<IIntentModel>(_ => new SystemOneIntentModel(options, new HttpClient()));
 19
 120        return services;
 121    }
 22}