< Summary

Information
Class: Ice.Internal.ObserverHelper
Assembly: Ice
File(s): /_/csharp/src/Ice/Internal/ObserverHelper.cs
Tag: 125_37167941578
Line coverage
100%
Covered lines: 16
Uncovered lines: 0
Coverable lines: 16
Total lines: 43
Line coverage: 100%
Branch coverage
100%
Covered branches: 10
Total branches: 10
Branch coverage: 100%
Method coverage
100%
Covered methods: 3
Fully covered methods: 3
Total methods: 3
Method coverage: 100%
Full method coverage: 100%

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get(...)100%44100%
get(...)100%66100%
.cctor()100%11100%

File(s)

/_/csharp/src/Ice/Internal/ObserverHelper.cs

#LineLine coverage
 1// Copyright (c) ZeroC, Inc.
 2
 3using Ice.Instrumentation;
 4
 5namespace Ice.Internal;
 6
 7public sealed class ObserverHelper
 8{
 9    public static InvocationObserver get(Instance instance, string op)
 10    {
 111        CommunicatorObserver obsv = instance.initializationData().observer;
 112        if (obsv != null)
 13        {
 114            InvocationObserver observer = obsv.getInvocationObserver(null, op, _emptyContext);
 115            observer?.attach();
 116            return observer;
 17        }
 118        return null;
 19    }
 20
 21    public static InvocationObserver get(Ice.ObjectPrx proxy, string op, Dictionary<string, string> context)
 22    {
 123        CommunicatorObserver obsv =
 124            ((Ice.ObjectPrxHelperBase)proxy).iceReference().getInstance().initializationData().observer;
 125        if (obsv != null)
 26        {
 27            InvocationObserver observer;
 128            if (context == null)
 29            {
 130                observer = obsv.getInvocationObserver(proxy, op, _emptyContext);
 31            }
 32            else
 33            {
 134                observer = obsv.getInvocationObserver(proxy, op, context);
 35            }
 136            observer?.attach();
 137            return observer;
 38        }
 139        return null;
 40    }
 41
 142    private static readonly Dictionary<string, string> _emptyContext = new Dictionary<string, string>();
 43}