< Summary

Line coverage
0%
Covered lines: 0
Uncovered lines: 12
Coverable lines: 12
Total lines: 35
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 4
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
.ctor()100%110%
ReleaseHandle()0%440%

File(s)

https://raw.githubusercontent.com/dotnet/runtime/811a7eabb75c42db53440e8ba3f60c07511cfd1f/src/libraries/Common/src/System/Net/Security/SecurityContextTokenHandle.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.Threading;
 5using Microsoft.Win32.SafeHandles;
 6
 7namespace System.Net.Security
 8{
 9#if DEBUG
 10    internal sealed class SecurityContextTokenHandle : DebugSafeHandleZeroOrMinusOneIsInvalid
 11    {
 12#else
 13    internal sealed class SecurityContextTokenHandle : SafeHandleZeroOrMinusOneIsInvalid
 14    {
 15#endif
 16        private int _disposed;
 17
 018        public SecurityContextTokenHandle() : base(true)
 019        {
 020        }
 21
 22        protected override bool ReleaseHandle()
 023        {
 024            if (!IsInvalid)
 025            {
 026                if (Interlocked.Increment(ref _disposed) == 1)
 027                {
 028                    return Interop.Kernel32.CloseHandle(handle);
 29                }
 030            }
 031            return true;
 032        }
 33    }
 34}
 35

Methods/Properties

.ctor()
ReleaseHandle()