< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.Dispatcher.PerCallInstanceContextProvider
Assembly: CoreWCF.Primitives
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/Dispatcher/PerCallInstanceContextProvider.cs
Line coverage
66%
Covered lines: 4
Uncovered lines: 2
Coverable lines: 6
Total lines: 42
Line coverage: 66.6%
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
.ctor(...)100%11100%
GetExistingInstanceContext(...)100%11100%
InitializeInstanceContext(...)100%11100%
IsIdle(...)100%110%
NotifyIdle(...)100%110%

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/Dispatcher/PerCallInstanceContextProvider.cs

#LineLine coverage
 1// Licensed to the .NET Foundation under one or more agreements.
 2// The .NET Foundation licenses this file to you under the MIT license.
 3
 4using System;
 5using CoreWCF.Channels;
 6
 7namespace CoreWCF.Dispatcher
 8{
 9    internal class PerCallInstanceContextProvider : InstanceContextProviderBase
 10    {
 11        internal PerCallInstanceContextProvider(DispatchRuntime dispatchRuntime)
 1312            : base(dispatchRuntime)
 13        {
 1314        }
 15
 16        #region IInstanceContextProvider Members
 17
 18        public override InstanceContext GetExistingInstanceContext(Message message, IContextChannel channel)
 19        {
 20            //Always return null so we will create new InstanceContext for each message
 11721            return null;
 22        }
 23
 24        public override void InitializeInstanceContext(InstanceContext instanceContext, Message message, IContextChannel
 25        {
 26            //no-op
 11727        }
 28
 29        public override bool IsIdle(InstanceContext instanceContext)
 30        {
 31            //By default return true if no channels are bound to this context
 032            return true;
 33        }
 34
 35        public override void NotifyIdle(Action<InstanceContext> callback, InstanceContext instanceContext)
 36        {
 37            //no-op
 038        }
 39
 40        #endregion
 41    }
 42}