< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.IdentityModel.WrappedXmlDictionaryReader
Assembly: CoreWCF.Primitives
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/IdentityModel/WrappedXmlDictionaryReader.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 91
Coverable lines: 91
Total lines: 465
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 10
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/IdentityModel/WrappedXmlDictionaryReader.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.Xml;
 6
 7namespace CoreWCF.IdentityModel
 8{
 9    /// <summary>
 10    /// This class wraps a given _reader and delegates all calls to it.
 11    /// XmlDictionaryReader class does not provide a way to set the _reader
 12    /// Quotas on the XmlDictionaryReader.CreateDictionaryReader(XmlReader)
 13    /// API. This class overrides XmlDictionaryReader.Quotas property and
 14    /// hence custom quotas can be specified.
 15    /// </summary>
 16    internal class WrappedXmlDictionaryReader : XmlDictionaryReader, IXmlLineInfo
 17    {
 18        private XmlReader _reader;
 19        private XmlDictionaryReaderQuotas _xmlDictionaryReaderQuotas;
 20
 021        public WrappedXmlDictionaryReader(
 022            XmlReader reader,
 023            XmlDictionaryReaderQuotas xmlDictionaryReaderQuotas)
 24        {
 025            if (reader == null)
 26            {
 027                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(reader));
 28            }
 29
 030            if (xmlDictionaryReaderQuotas == null)
 31            {
 032                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(xmlDictionaryReaderQuotas));
 33            }
 34
 035            _reader = reader;
 036            _xmlDictionaryReaderQuotas = xmlDictionaryReaderQuotas;
 037        }
 38
 39        public override int AttributeCount
 40        {
 41            get
 42            {
 043                return _reader.AttributeCount;
 44            }
 45        }
 46
 47        public override string BaseURI
 48        {
 49            get
 50            {
 051                return _reader.BaseURI;
 52            }
 53        }
 54
 55        public override bool CanReadBinaryContent
 56        {
 057            get { return _reader.CanReadBinaryContent; }
 58        }
 59
 60        public override bool CanReadValueChunk
 61        {
 062            get { return _reader.CanReadValueChunk; }
 63        }
 64
 65        public override int Depth
 66        {
 67            get
 68            {
 069                return _reader.Depth;
 70            }
 71        }
 72
 73        public override bool EOF
 74        {
 75            get
 76            {
 077                return _reader.EOF;
 78            }
 79        }
 80
 81        public override bool HasValue
 82        {
 83            get
 84            {
 085                return _reader.HasValue;
 86            }
 87        }
 88
 89        public override bool IsDefault
 90        {
 91            get
 92            {
 093                return _reader.IsDefault;
 94            }
 95        }
 96
 97        public override bool IsEmptyElement
 98        {
 99            get
 100            {
 0101                return _reader.IsEmptyElement;
 102            }
 103        }
 104
 105        public override string LocalName
 106        {
 107            get
 108            {
 0109                return _reader.LocalName;
 110            }
 111        }
 112
 113        public override string Name
 114        {
 115            get
 116            {
 0117                return _reader.Name;
 118            }
 119        }
 120
 121        public override string NamespaceURI
 122        {
 123            get
 124            {
 0125                return _reader.NamespaceURI;
 126            }
 127        }
 128
 129        public override XmlNameTable NameTable
 130        {
 131            get
 132            {
 0133                return _reader.NameTable;
 134            }
 135        }
 136
 137        public override XmlNodeType NodeType
 138        {
 139            get
 140            {
 0141                return _reader.NodeType;
 142            }
 143        }
 144
 145        public override string Prefix
 146        {
 147            get
 148            {
 0149                return _reader.Prefix;
 150            }
 151        }
 152
 153        public override char QuoteChar
 154        {
 155            get
 156            {
 0157                return _reader.QuoteChar;
 158            }
 159        }
 160
 161        public override ReadState ReadState
 162        {
 163            get
 164            {
 0165                return _reader.ReadState;
 166            }
 167        }
 168
 169        public override string Value
 170        {
 171            get
 172            {
 0173                return _reader.Value;
 174            }
 175        }
 176
 177        public override string XmlLang
 178        {
 179            get
 180            {
 0181                return _reader.XmlLang;
 182            }
 183        }
 184
 185        public override XmlSpace XmlSpace
 186        {
 187            get
 188            {
 0189                return _reader.XmlSpace;
 190            }
 191        }
 192
 193        public override Type ValueType
 194        {
 195            get
 196            {
 0197                return _reader.ValueType;
 198            }
 199        }
 200
 201        public int LineNumber
 202        {
 203            get
 204            {
 0205                IXmlLineInfo lineInfo = _reader as IXmlLineInfo;
 206
 0207                if (lineInfo == null)
 208                {
 0209                    return 1;
 210                }
 211
 0212                return lineInfo.LineNumber;
 213            }
 214        }
 215
 216        public int LinePosition
 217        {
 218            get
 219            {
 0220                IXmlLineInfo lineInfo = _reader as IXmlLineInfo;
 221
 0222                if (lineInfo == null)
 223                {
 0224                    return 1;
 225                }
 226
 0227                return lineInfo.LinePosition;
 228            }
 229        }
 230
 231        public override XmlDictionaryReaderQuotas Quotas
 232        {
 233            get
 234            {
 0235                return _xmlDictionaryReaderQuotas;
 236            }
 237        }
 238
 239        public override string this[int index]
 240        {
 241            get
 242            {
 0243                return _reader[index];
 244            }
 245        }
 246
 247        public override string this[string name]
 248        {
 249            get
 250            {
 0251                return _reader[name];
 252            }
 253        }
 254
 255        public override string this[string name, string namespaceUri]
 256        {
 257            get
 258            {
 0259                return _reader[name, namespaceUri];
 260            }
 261        }
 262
 263        public override void Close()
 264        {
 0265            _reader.Close();
 0266        }
 267
 268        public override string GetAttribute(int index)
 269        {
 0270            return _reader.GetAttribute(index);
 271        }
 272
 273        public override string GetAttribute(string name)
 274        {
 0275            return _reader.GetAttribute(name);
 276        }
 277
 278        public override string GetAttribute(string name, string namespaceUri)
 279        {
 0280            return _reader.GetAttribute(name, namespaceUri);
 281        }
 282
 283        public override bool IsStartElement(string name)
 284        {
 0285            return _reader.IsStartElement(name);
 286        }
 287
 288        public override bool IsStartElement(string localName, string namespaceUri)
 289        {
 0290            return _reader.IsStartElement(localName, namespaceUri);
 291        }
 292
 293        public override string LookupNamespace(string namespaceUri)
 294        {
 0295            return _reader.LookupNamespace(namespaceUri);
 296        }
 297
 298        public override void MoveToAttribute(int index)
 299        {
 0300            _reader.MoveToAttribute(index);
 0301        }
 302
 303        public override bool MoveToAttribute(string name)
 304        {
 0305            return _reader.MoveToAttribute(name);
 306        }
 307
 308        public override bool MoveToAttribute(string name, string namespaceUri)
 309        {
 0310            return _reader.MoveToAttribute(name, namespaceUri);
 311        }
 312
 313        public override bool MoveToElement()
 314        {
 0315            return _reader.MoveToElement();
 316        }
 317
 318        public override bool MoveToFirstAttribute()
 319        {
 0320            return _reader.MoveToFirstAttribute();
 321        }
 322
 323        public override bool MoveToNextAttribute()
 324        {
 0325            return _reader.MoveToNextAttribute();
 326        }
 327
 328        public override bool Read()
 329        {
 0330            return _reader.Read();
 331        }
 332
 333        public override bool ReadAttributeValue()
 334        {
 0335            return _reader.ReadAttributeValue();
 336        }
 337
 338        public override string ReadElementString(string name)
 339        {
 0340            return _reader.ReadElementString(name);
 341        }
 342
 343        public override string ReadElementString(string localName, string namespaceUri)
 344        {
 0345            return _reader.ReadElementString(localName, namespaceUri);
 346        }
 347
 348        public override string ReadInnerXml()
 349        {
 0350            return _reader.ReadInnerXml();
 351        }
 352
 353        public override string ReadOuterXml()
 354        {
 0355            return _reader.ReadOuterXml();
 356        }
 357
 358        public override void ReadStartElement(string name)
 359        {
 0360            _reader.ReadStartElement(name);
 0361        }
 362
 363        public override void ReadStartElement(string localName, string namespaceUri)
 364        {
 0365            _reader.ReadStartElement(localName, namespaceUri);
 0366        }
 367
 368        public override void ReadEndElement()
 369        {
 0370            _reader.ReadEndElement();
 0371        }
 372
 373        public override string ReadString()
 374        {
 0375            return _reader.ReadString();
 376        }
 377
 378        public override void ResolveEntity()
 379        {
 0380            _reader.ResolveEntity();
 0381        }
 382
 383        public override int ReadElementContentAsBase64(byte[] buffer, int offset, int count)
 384        {
 0385            return _reader.ReadElementContentAsBase64(buffer, offset, count);
 386        }
 387
 388        public override int ReadContentAsBase64(byte[] buffer, int offset, int count)
 389        {
 0390            return _reader.ReadContentAsBase64(buffer, offset, count);
 391        }
 392
 393        public override int ReadElementContentAsBinHex(byte[] buffer, int offset, int count)
 394        {
 0395            return _reader.ReadElementContentAsBinHex(buffer, offset, count);
 396        }
 397
 398        public override int ReadContentAsBinHex(byte[] buffer, int offset, int count)
 399        {
 0400            return _reader.ReadContentAsBinHex(buffer, offset, count);
 401        }
 402
 403        public override int ReadValueChunk(char[] chars, int offset, int count)
 404        {
 0405            return _reader.ReadValueChunk(chars, offset, count);
 406        }
 407
 408        public override bool ReadContentAsBoolean()
 409        {
 0410            return _reader.ReadContentAsBoolean();
 411        }
 412
 413        public override DateTime ReadContentAsDateTime()
 414        {
 0415            return _reader.ReadContentAsDateTime();
 416        }
 417
 418        public override decimal ReadContentAsDecimal()
 419        {
 0420            return (decimal)_reader.ReadContentAs(typeof(decimal), null);
 421        }
 422
 423        public override double ReadContentAsDouble()
 424        {
 0425            return _reader.ReadContentAsDouble();
 426        }
 427
 428        public override int ReadContentAsInt()
 429        {
 0430            return _reader.ReadContentAsInt();
 431        }
 432
 433        public override long ReadContentAsLong()
 434        {
 0435            return _reader.ReadContentAsLong();
 436        }
 437
 438        public override float ReadContentAsFloat()
 439        {
 0440            return _reader.ReadContentAsFloat();
 441        }
 442
 443        public override string ReadContentAsString()
 444        {
 0445            return _reader.ReadContentAsString();
 446        }
 447
 448        public override object ReadContentAs(Type valueType, IXmlNamespaceResolver namespaceResolver)
 449        {
 0450            return _reader.ReadContentAs(valueType, namespaceResolver);
 451        }
 452
 453        public bool HasLineInfo()
 454        {
 0455            IXmlLineInfo lineInfo = _reader as IXmlLineInfo;
 456
 0457            if (lineInfo == null)
 458            {
 0459                return false;
 460            }
 461
 0462            return lineInfo.HasLineInfo();
 463        }
 464    }
 465}

Methods/Properties

.ctor(System.Xml.XmlReader,System.Xml.XmlDictionaryReaderQuotas)
AttributeCount()
BaseURI()
CanReadBinaryContent()
CanReadValueChunk()
Depth()
EOF()
HasValue()
IsDefault()
IsEmptyElement()
LocalName()
Name()
NamespaceURI()
NameTable()
NodeType()
Prefix()
QuoteChar()
ReadState()
Value()
XmlLang()
XmlSpace()
ValueType()
LineNumber()
LinePosition()
Quotas()
Item(System.Int32)
Item(System.String)
Item(System.String,System.String)
Close()
GetAttribute(System.Int32)
GetAttribute(System.String)
GetAttribute(System.String,System.String)
IsStartElement(System.String)
IsStartElement(System.String,System.String)
LookupNamespace(System.String)
MoveToAttribute(System.Int32)
MoveToAttribute(System.String)
MoveToAttribute(System.String,System.String)
MoveToElement()
MoveToFirstAttribute()
MoveToNextAttribute()
Read()
ReadAttributeValue()
ReadElementString(System.String)
ReadElementString(System.String,System.String)
ReadInnerXml()
ReadOuterXml()
ReadStartElement(System.String)
ReadStartElement(System.String,System.String)
ReadEndElement()
ReadString()
ResolveEntity()
ReadElementContentAsBase64(System.Byte[],System.Int32,System.Int32)
ReadContentAsBase64(System.Byte[],System.Int32,System.Int32)
ReadElementContentAsBinHex(System.Byte[],System.Int32,System.Int32)
ReadContentAsBinHex(System.Byte[],System.Int32,System.Int32)
ReadValueChunk(System.Char[],System.Int32,System.Int32)
ReadContentAsBoolean()
ReadContentAsDateTime()
ReadContentAsDecimal()
ReadContentAsDouble()
ReadContentAsInt()
ReadContentAsLong()
ReadContentAsFloat()
ReadContentAsString()
ReadContentAs(System.Type,System.Xml.IXmlNamespaceResolver)
HasLineInfo()