< Summary

Class:Azure.AI.TextAnalytics.Models.SentenceSentimentValueExtensions
Assembly:Azure.AI.TextAnalytics
File(s):C:\Git\azure-sdk-for-net\sdk\textanalytics\Azure.AI.TextAnalytics\src\Generated\Models\SentenceSentimentValue.Serialization.cs
Covered lines:0
Uncovered lines:11
Coverable lines:11
Total lines:30
Line coverage:0% (0 of 11)
Covered branches:0
Total branches:10
Branch coverage:0% (0 of 10)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
ToSerialString(...)-0%0%
ToSentenceSentimentValue(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\textanalytics\Azure.AI.TextAnalytics\src\Generated\Models\SentenceSentimentValue.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.AI.TextAnalytics.Models
 11{
 12    internal static class SentenceSentimentValueExtensions
 13    {
 014        public static string ToSerialString(this SentenceSentimentValue value) => value switch
 015        {
 016            SentenceSentimentValue.Positive => "positive",
 017            SentenceSentimentValue.Neutral => "neutral",
 018            SentenceSentimentValue.Negative => "negative",
 019            _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown SentenceSentimentValue value.")
 020        };
 21
 22        public static SentenceSentimentValue ToSentenceSentimentValue(this string value)
 23        {
 024            if (string.Equals(value, "positive", StringComparison.InvariantCultureIgnoreCase)) return SentenceSentimentV
 025            if (string.Equals(value, "neutral", StringComparison.InvariantCultureIgnoreCase)) return SentenceSentimentVa
 026            if (string.Equals(value, "negative", StringComparison.InvariantCultureIgnoreCase)) return SentenceSentimentV
 027            throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown SentenceSentimentValue value.");
 28        }
 29    }
 30}