< Summary

Class:Azure.Core.Http.Multipart.GenericHeaderParser`1
Assembly:Azure.Storage.Blobs.Batch
File(s):C:\Git\azure-sdk-for-net\sdk\storage\Azure.Storage.Blobs.Batch\src\Shared\GenericHeaderParser.cs
Covered lines:0
Uncovered lines:6
Coverable lines:6
Total lines:35
Line coverage:0% (0 of 6)
Covered branches:0
Total branches:2
Branch coverage:0% (0 of 2)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
GetParsedValueLength(...)-0%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\storage\Azure.Storage.Blobs.Batch\src\Shared\GenericHeaderParser.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4// Copied from https://github.com/aspnet/AspNetCore/tree/master/src/Http/Headers/src
 5
 6using System;
 7
 8#pragma warning disable IDE0016 // Simplify null check
 9#pragma warning disable IDE0044 // Make field readonly
 10
 11namespace Azure.Core.Http.Multipart
 12{
 13    internal sealed class GenericHeaderParser<T> : BaseHeaderParser<T>
 14    {
 15        internal delegate int GetParsedValueLengthDelegate(StringSegment value, int startIndex, out T parsedValue);
 16
 17        private GetParsedValueLengthDelegate _getParsedValueLength;
 18
 19        internal GenericHeaderParser(bool supportsMultipleValues, GetParsedValueLengthDelegate getParsedValueLength)
 020            : base(supportsMultipleValues)
 21        {
 022            if (getParsedValueLength == null)
 23            {
 024                throw new ArgumentNullException(nameof(getParsedValueLength));
 25            }
 26
 027            _getParsedValueLength = getParsedValueLength;
 028        }
 29
 30        protected override int GetParsedValueLength(StringSegment value, int startIndex, out T parsedValue)
 31        {
 032            return _getParsedValueLength(value, startIndex, out parsedValue);
 33        }
 34    }
 35}