< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.IdentityModel.Selectors.UserNamePasswordValidator
Assembly: CoreWCF.Primitives
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/IdentityModel/Selectors/UserNamePasswordValidator.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 7
Coverable lines: 7
Total lines: 43
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 2
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
Validate(...)100%110%
ValidateAsync(...)100%110%
ValidateAsync(...)100%110%

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/IdentityModel/Selectors/UserNamePasswordValidator.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 System.Threading.Tasks;
 6
 7namespace CoreWCF.IdentityModel.Selectors
 8{
 9    // TODO: Either consider moving this back to System.IdentityModel.Selectors and/or move to ServiceModel and make asy
 10    public abstract class UserNamePasswordValidator
 11    {
 12        private static UserNamePasswordValidator s_none;
 13
 14        public static UserNamePasswordValidator None
 15        {
 16            get
 17            {
 018                if (s_none == null)
 19                {
 020                    s_none = new NoneUserNamePasswordValidator();
 21                }
 22
 023                return s_none;
 24            }
 25        }
 26
 27        [Obsolete("Implementers should override ValidateAsync.")]
 028        public virtual void Validate(string userName, string password) => throw new NotImplementedException(SR.Synchrono
 29
 30        public virtual ValueTask ValidateAsync(string userName, string password)
 31        {
 32#pragma warning disable CS0618 // Type or member is obsolete
 033            Validate(userName, password);
 34#pragma warning restore CS0618 // Type or member is obsolete
 035            return new ValueTask();
 36        }
 37
 38        private class NoneUserNamePasswordValidator : UserNamePasswordValidator
 39        {
 040            public override ValueTask ValidateAsync(string userName, string password) => new ValueTask();
 41        }
 42    }
 43}