< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.Security.RequestSecurityTokenResponseCollection
Assembly: CoreWCF.Primitives
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/Security/RequestSecurityTokenResponseCollection.cs
Line coverage
77%
Covered lines: 14
Uncovered lines: 4
Coverable lines: 18
Total lines: 54
Line coverage: 77.7%
Branch coverage
62%
Covered branches: 5
Total branches: 8
Branch coverage: 62.5%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
.ctor(...)100%110%
.ctor(...)62.5%8881.81%
WriteTo(...)100%11100%
OnWriteBodyContents(...)100%11100%

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/Security/RequestSecurityTokenResponseCollection.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.Collections.Generic;
 6using System.Globalization;
 7using System.Xml;
 8using CoreWCF.Channels;
 9
 10namespace CoreWCF.Security
 11{
 12    internal sealed class RequestSecurityTokenResponseCollection : BodyWriter
 13    {
 14        private readonly SecurityStandardsManager _standardsManager;
 15
 16        public RequestSecurityTokenResponseCollection(IEnumerable<RequestSecurityTokenResponse> rstrCollection)
 017            : this(rstrCollection, SecurityStandardsManager.DefaultInstance)
 018        { }
 19
 20        public RequestSecurityTokenResponseCollection(IEnumerable<RequestSecurityTokenResponse> rstrCollection, Security
 821            : base(true)
 22        {
 823            if (rstrCollection == null)
 24            {
 025                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(rstrCollection));
 26            }
 27
 828            int index = 0;
 3229            foreach (RequestSecurityTokenResponse rstr in rstrCollection)
 30            {
 831                if (rstr == null)
 32                {
 033                    throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(string.Format(CultureInfo.Invariant
 34                }
 35
 836                ++index;
 37            }
 838            RstrCollection = rstrCollection;
 839            _standardsManager = standardsManager ?? throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new Argume
 840        }
 41
 842        public IEnumerable<RequestSecurityTokenResponse> RstrCollection { get; }
 43
 44        public void WriteTo(XmlWriter writer)
 45        {
 846            _standardsManager.TrustDriver.WriteRequestSecurityTokenResponseCollection(this, writer);
 847        }
 48
 49        protected override void OnWriteBodyContents(XmlDictionaryWriter writer)
 50        {
 851            WriteTo(writer);
 852        }
 53    }
 54}