< Summary

Class:Microsoft.Azure.Search.Models.EntityCategoryEnumExtension
Assembly:Microsoft.Azure.Search.Service
File(s):C:\Git\azure-sdk-for-net\sdk\search\Microsoft.Azure.Search.Service\src\Generated\Models\EntityCategory.cs
Covered lines:0
Uncovered lines:17
Coverable lines:17
Total lines:90
Line coverage:0% (0 of 17)
Covered branches:0
Total branches:42
Branch coverage:0% (0 of 42)

Metrics

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

File(s)

C:\Git\azure-sdk-for-net\sdk\search\Microsoft.Azure.Search.Service\src\Generated\Models\EntityCategory.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 EntityCategory.
 20    /// </summary>
 21    [JsonConverter(typeof(StringEnumConverter))]
 22    public enum EntityCategory
 23    {
 24        [EnumMember(Value = "location")]
 25        Location,
 26        [EnumMember(Value = "organization")]
 27        Organization,
 28        [EnumMember(Value = "person")]
 29        Person,
 30        [EnumMember(Value = "quantity")]
 31        Quantity,
 32        [EnumMember(Value = "datetime")]
 33        Datetime,
 34        [EnumMember(Value = "url")]
 35        Url,
 36        [EnumMember(Value = "email")]
 37        Email
 38    }
 39    internal static class EntityCategoryEnumExtension
 40    {
 41        internal static string ToSerializedValue(this EntityCategory? value)
 42        {
 043            return value == null ? null : ((EntityCategory)value).ToSerializedValue();
 44        }
 45
 46        internal static string ToSerializedValue(this EntityCategory value)
 47        {
 48            switch( value )
 49            {
 50                case EntityCategory.Location:
 051                    return "location";
 52                case EntityCategory.Organization:
 053                    return "organization";
 54                case EntityCategory.Person:
 055                    return "person";
 56                case EntityCategory.Quantity:
 057                    return "quantity";
 58                case EntityCategory.Datetime:
 059                    return "datetime";
 60                case EntityCategory.Url:
 061                    return "url";
 62                case EntityCategory.Email:
 063                    return "email";
 64            }
 065            return null;
 66        }
 67
 68        internal static EntityCategory? ParseEntityCategory(this string value)
 69        {
 70            switch( value )
 71            {
 72                case "location":
 073                    return EntityCategory.Location;
 74                case "organization":
 075                    return EntityCategory.Organization;
 76                case "person":
 077                    return EntityCategory.Person;
 78                case "quantity":
 079                    return EntityCategory.Quantity;
 80                case "datetime":
 081                    return EntityCategory.Datetime;
 82                case "url":
 083                    return EntityCategory.Url;
 84                case "email":
 085                    return EntityCategory.Email;
 86            }
 087            return null;
 88        }
 89    }
 90}