< Summary

Class:Azure.Messaging.EventGrid.ServiceVersionExtensions
Assembly:Azure.Messaging.EventGrid
File(s):C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Customization\ServiceVersionExtensions.cs
Covered lines:4
Uncovered lines:1
Coverable lines:5
Total lines:20
Line coverage:80% (4 of 5)
Covered branches:1
Total branches:2
Branch coverage:50% (1 of 2)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
GetVersionString(...)-80%50%

File(s)

C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Customization\ServiceVersionExtensions.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4using System;
 5using static Azure.Messaging.EventGrid.EventGridPublisherClientOptions;
 6
 7namespace Azure.Messaging.EventGrid
 8{
 9    internal static class ServiceVersionExtensions
 10    {
 11        internal static string GetVersionString(this ServiceVersion version)
 12        {
 8813            return version switch
 8814            {
 17615                ServiceVersion.V2018_01_01 => "2018-01-01",
 016                _ => throw new ArgumentException($"Version {version.ToString()} not supported."),
 8817            };
 18        }
 19    }
 20}

Methods/Properties

GetVersionString(...)