< Summary

Class:Microsoft.Azure.Search.Models.AutocompleteModeEnumExtension
Assembly:Microsoft.Azure.Search.Data
File(s):C:\Git\azure-sdk-for-net\sdk\search\Microsoft.Azure.Search.Data\src\Generated\Models\AutocompleteMode.cs
Covered lines:0
Uncovered lines:9
Coverable lines:9
Total lines:66
Line coverage:0% (0 of 9)
Covered branches:0
Total branches:12
Branch coverage:0% (0 of 12)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
ToSerializedValue(...)-0%0%
ToSerializedValue(...)-0%0%
ParseAutocompleteMode(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\search\Microsoft.Azure.Search.Data\src\Generated\Models\AutocompleteMode.cs

#LineLine coverage
 1// <auto-generated>
 2// Copyright (c) Microsoft Corporation. All rights reserved.
 3// Licensed under the MIT License. See License.txt in the project root for
 4// license information.
 5//
 6// Code generated by Microsoft (R) AutoRest Code Generator.
 7// Changes may cause incorrect behavior and will be lost if the code is
 8// regenerated.
 9// </auto-generated>
 10
 11namespace Microsoft.Azure.Search.Models
 12{
 13    using Newtonsoft.Json;
 14    using Newtonsoft.Json.Converters;
 15    using System.Runtime;
 16    using System.Runtime.Serialization;
 17
 18    /// <summary>
 19    /// Defines values for AutocompleteMode.
 20    /// </summary>
 21    [JsonConverter(typeof(StringEnumConverter))]
 22    public enum AutocompleteMode
 23    {
 24        [EnumMember(Value = "oneTerm")]
 25        OneTerm,
 26        [EnumMember(Value = "twoTerms")]
 27        TwoTerms,
 28        [EnumMember(Value = "oneTermWithContext")]
 29        OneTermWithContext
 30    }
 31    internal static class AutocompleteModeEnumExtension
 32    {
 33        internal static string ToSerializedValue(this AutocompleteMode? value)
 34        {
 035            return value == null ? null : ((AutocompleteMode)value).ToSerializedValue();
 36        }
 37
 38        internal static string ToSerializedValue(this AutocompleteMode value)
 39        {
 40            switch( value )
 41            {
 42                case AutocompleteMode.OneTerm:
 043                    return "oneTerm";
 44                case AutocompleteMode.TwoTerms:
 045                    return "twoTerms";
 46                case AutocompleteMode.OneTermWithContext:
 047                    return "oneTermWithContext";
 48            }
 049            return null;
 50        }
 51
 52        internal static AutocompleteMode? ParseAutocompleteMode(this string value)
 53        {
 54            switch( value )
 55            {
 56                case "oneTerm":
 057                    return AutocompleteMode.OneTerm;
 58                case "twoTerms":
 059                    return AutocompleteMode.TwoTerms;
 60                case "oneTermWithContext":
 061                    return AutocompleteMode.OneTermWithContext;
 62            }
 063            return null;
 64        }
 65    }
 66}