< Summary

Class:Azure.Core.RequestUriBuilderExtensions
Assembly:Azure.Search.Documents
File(s):C:\Git\azure-sdk-for-net\sdk\core\Azure.Core\src\Shared\AutoRest\RequestUriBuilderExtensions.cs
Covered lines:4
Uncovered lines:34
Coverable lines:38
Total lines:110
Line coverage:10.5% (4 of 38)
Covered branches:0
Total branches:0

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
AppendPath(...)-0%100%
AppendPath(...)-0%100%
AppendPath(...)-0%100%
AppendPath(...)-0%100%
AppendPath(...)-0%100%
AppendPath(...)-0%100%
AppendPath(...)-0%100%
AppendPath(...)-0%100%
AppendPath(...)-0%100%
AppendQuery(...)-100%100%
AppendQuery(...)-0%100%
AppendQuery(...)-0%100%
AppendQuery(...)-0%100%
AppendQuery(...)-0%100%
AppendQuery(...)-0%100%
AppendQuery(...)-0%100%
AppendQuery(...)-0%100%
AppendQuery(...)-0%100%
AppendQueryDelimited(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\core\Azure.Core\src\Shared\AutoRest\RequestUriBuilderExtensions.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4#nullable enable
 5
 6using System;
 7using System.Collections.Generic;
 8using System.Globalization;
 9using System.Xml;
 10
 11namespace Azure.Core
 12{
 13    internal static class RequestUriBuilderExtensions
 14    {
 15        public static void AppendPath(this RequestUriBuilder builder, bool value, bool escape = false)
 16        {
 017            builder.AppendPath(TypeFormatters.ToString(value), escape);
 018        }
 19
 20        public static void AppendPath(this RequestUriBuilder builder, float value, bool escape = true)
 21        {
 022            builder.AppendPath(value.ToString(TypeFormatters.DefaultNumberFormat, CultureInfo.InvariantCulture), escape)
 023        }
 24
 25        public static void AppendPath(this RequestUriBuilder builder, double value, bool escape = true)
 26        {
 027            builder.AppendPath(value.ToString(TypeFormatters.DefaultNumberFormat, CultureInfo.InvariantCulture), escape)
 028        }
 29
 30        public static void AppendPath(this RequestUriBuilder builder, int value, bool escape = true)
 31        {
 032            builder.AppendPath(value.ToString(TypeFormatters.DefaultNumberFormat, CultureInfo.InvariantCulture), escape)
 033        }
 34
 35        public static void AppendPath(this RequestUriBuilder builder, byte[] value, bool escape = true)
 36        {
 037            builder.AppendPath(TypeFormatters.ToBase64UrlString(value), escape);
 038        }
 39
 40        public static void AppendPath(this RequestUriBuilder builder, IEnumerable<string> value, bool escape = true)
 41        {
 042            builder.AppendPath(string.Join(",", value), escape);
 043        }
 44
 45        public static void AppendPath(this RequestUriBuilder builder, DateTimeOffset value, string format, bool escape =
 46        {
 047            builder.AppendPath(TypeFormatters.ToString(value, format), escape);
 048        }
 49
 50        public static void AppendPath(this RequestUriBuilder builder, TimeSpan value, string format, bool escape = true)
 51        {
 052            builder.AppendPath(TypeFormatters.ToString(value, format), escape);
 053        }
 54
 55        public static void AppendPath(this RequestUriBuilder builder, Guid value, bool escape = true)
 56        {
 057            builder.AppendPath(value.ToString(), escape);
 058        }
 59
 60        public static void AppendQuery(this RequestUriBuilder builder, string name, bool value, bool escape = false)
 61        {
 262            builder.AppendQuery(name, TypeFormatters.ToString(value), escape);
 263        }
 64
 65        public static void AppendQuery(this RequestUriBuilder builder, string name, float value, bool escape = true)
 66        {
 067            builder.AppendQuery(name, value.ToString(TypeFormatters.DefaultNumberFormat, CultureInfo.InvariantCulture), 
 068        }
 69
 70        public static void AppendQuery(this RequestUriBuilder builder, string name, DateTimeOffset value, string format,
 71        {
 072            builder.AppendQuery(name, TypeFormatters.ToString(value, format), escape);
 073        }
 74
 75        public static void AppendQuery(this RequestUriBuilder builder, string name, TimeSpan value, string format, bool 
 76        {
 077            builder.AppendQuery(name, TypeFormatters.ToString(value, format), escape);
 078        }
 79
 80        public static void AppendQuery(this RequestUriBuilder builder, string name, double value, bool escape = true)
 81        {
 082            builder.AppendQuery(name, value.ToString(TypeFormatters.DefaultNumberFormat, CultureInfo.InvariantCulture), 
 083        }
 84
 85        public static void AppendQuery(this RequestUriBuilder builder, string name, int value, bool escape = true)
 86        {
 087            builder.AppendQuery(name, value.ToString(TypeFormatters.DefaultNumberFormat, CultureInfo.InvariantCulture), 
 088        }
 89
 90        public static void AppendQuery(this RequestUriBuilder builder, string name, TimeSpan value, bool escape = true)
 91        {
 092            builder.AppendQuery(name, XmlConvert.ToString(value), escape);
 093        }
 94
 95        public static void AppendQuery(this RequestUriBuilder builder, string name, byte[] value, bool escape = true)
 96        {
 097            builder.AppendQuery(name, Convert.ToBase64String(value), escape);
 098        }
 99
 100        public static void AppendQuery(this RequestUriBuilder builder, string name, Guid value, bool escape = true)
 101        {
 0102            builder.AppendQuery(name, value.ToString(), escape);
 0103        }
 104
 105        public static void AppendQueryDelimited<T>(this RequestUriBuilder builder, string name, IEnumerable<T> value, st
 106        {
 12107            builder.AppendQuery(name, string.Join(delimiter, value), escape);
 12108        }
 109    }
 110}