< Summary

Class:Microsoft.Extensions.DependencyInjection.AddKafkaExtension
Assembly:SeungYongShim.Kafka.DependencyInjection
File(s):/home/runner/work/SeungYongShim.Kafka/SeungYongShim.Kafka/src/SeungYongShim.Kafka.DependencyInjection/AddKafkaExtension.cs
Covered lines:7
Uncovered lines:0
Coverable lines:7
Total lines:22
Line coverage:100% (7 of 7)
Covered branches:0
Total branches:0
Tag:50_866899697

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
AddKafka(...)0%110100%

File(s)

/home/runner/work/SeungYongShim.Kafka/SeungYongShim.Kafka/src/SeungYongShim.Kafka.DependencyInjection/AddKafkaExtension.cs

#LineLine coverage
 1using System.Collections.Generic;
 2using System.Linq;
 3using SeungYongShim.Kafka;
 4using SeungYongShim.ProtobufHelper;
 5
 6namespace Microsoft.Extensions.DependencyInjection
 7{
 8    public static class AddKafkaExtension
 9    {
 10        internal static IServiceCollection AddKafka(this IServiceCollection services,
 11                                                    KafkaConfig kafkaConfig,
 12                                                    IEnumerable<string> searchPatterns)
 213        {
 214            services.AddTransient<KafkaConsumer>();
 215            services.AddTransient<KafkaProducer>();
 416            services.AddSingleton(sp => new ProtoKnownTypes(searchPatterns.ToArray()));
 417            services.AddSingleton(sp => kafkaConfig);
 18
 219            return services;
 220        }
 21    }
 22}