< Summary

Class:Microsoft.Azure.EventHubs.Processor.DefaultEventProcessorFactory`1
Assembly:Microsoft.Azure.EventHubs.Processor
File(s):C:\Git\azure-sdk-for-net\sdk\eventhub\Microsoft.Azure.EventHubs.Processor\src\DefaultEventProcessorFactory.cs
Covered lines:0
Uncovered lines:8
Coverable lines:8
Total lines:30
Line coverage:0% (0 of 8)
Covered branches:0
Total branches:2
Branch coverage:0% (0 of 2)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
CreateEventProcessor(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\eventhub\Microsoft.Azure.EventHubs.Processor\src\DefaultEventProcessorFactory.cs

#LineLine coverage
 1// Copyright (c) Microsoft. All rights reserved.
 2// Licensed under the MIT license. See LICENSE file in the project root for full license information.
 3
 4namespace Microsoft.Azure.EventHubs.Processor
 5{
 6    class DefaultEventProcessorFactory<TEventProcessor> : IEventProcessorFactory
 7        where TEventProcessor : IEventProcessor, new()
 8    {
 9        readonly TEventProcessor instance;
 10
 011        public DefaultEventProcessorFactory()
 12        {
 013        }
 14
 015        public DefaultEventProcessorFactory(TEventProcessor instance)
 16        {
 017            this.instance = instance;
 018        }
 19
 20        public IEventProcessor CreateEventProcessor(PartitionContext context)
 21        {
 022            if (this.instance == null)
 23            {
 024                return new TEventProcessor();
 25            }
 26
 027            return this.instance;
 28        }
 29    }
 30}