< Summary

Class:Azure.Search.Documents.Models.IndexActionTypeExtensions
Assembly:Azure.Search.Documents
File(s):C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\IndexActionType.Serialization.cs
Covered lines:7
Uncovered lines:6
Coverable lines:13
Total lines:32
Line coverage:53.8% (7 of 13)
Covered branches:4
Total branches:13
Branch coverage:30.7% (4 of 13)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
ToSerialString(...)-87.5%80%
ToIndexActionType(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\IndexActionType.Serialization.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4// <auto-generated/>
 5
 6#nullable disable
 7
 8using System;
 9
 10namespace Azure.Search.Documents.Models
 11{
 12    internal static class IndexActionTypeExtensions
 13    {
 1668514        public static string ToSerialString(this IndexActionType value) => value switch
 1668515        {
 3331516            IndexActionType.Upload => "upload",
 1670617            IndexActionType.Merge => "merge",
 1669918            IndexActionType.MergeOrUpload => "mergeOrUpload",
 1670519            IndexActionType.Delete => "delete",
 020            _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown IndexActionType value.")
 1668521        };
 22
 23        public static IndexActionType ToIndexActionType(this string value)
 24        {
 025            if (string.Equals(value, "upload", StringComparison.InvariantCultureIgnoreCase)) return IndexActionType.Uplo
 026            if (string.Equals(value, "merge", StringComparison.InvariantCultureIgnoreCase)) return IndexActionType.Merge
 027            if (string.Equals(value, "mergeOrUpload", StringComparison.InvariantCultureIgnoreCase)) return IndexActionTy
 028            if (string.Equals(value, "delete", StringComparison.InvariantCultureIgnoreCase)) return IndexActionType.Dele
 029            throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown IndexActionType value.");
 30        }
 31    }
 32}