< Summary

Class:Azure.ResourceManager.Network.Models.SecurityRuleProtocol
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\SecurityRuleProtocol.cs
Covered lines:7
Uncovered lines:8
Coverable lines:15
Total lines:62
Line coverage:46.6% (7 of 15)
Covered branches:1
Total branches:6
Branch coverage:16.6% (1 of 6)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-100%50%
get_Tcp()-100%100%
get_Udp()-100%100%
get_Icmp()-0%100%
get_Esp()-0%100%
get_Asterisk()-100%100%
get_Ah()-0%100%
op_Equality(...)-0%100%
op_Inequality(...)-0%100%
op_Implicit(...)-0%100%
Equals(...)-0%0%
Equals(...)-100%100%
GetHashCode()-0%0%
ToString()-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\SecurityRuleProtocol.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;
 9using System.ComponentModel;
 10
 11namespace Azure.ResourceManager.Network.Models
 12{
 13    /// <summary> Network protocol this rule applies to. </summary>
 14    public readonly partial struct SecurityRuleProtocol : IEquatable<SecurityRuleProtocol>
 15    {
 16        private readonly string _value;
 17
 18        /// <summary> Determines if two <see cref="SecurityRuleProtocol"/> values are the same. </summary>
 19        public SecurityRuleProtocol(string value)
 20        {
 280021            _value = value ?? throw new ArgumentNullException(nameof(value));
 280022        }
 23
 24        private const string TcpValue = "Tcp";
 25        private const string UdpValue = "Udp";
 26        private const string IcmpValue = "Icmp";
 27        private const string EspValue = "Esp";
 28        private const string AsteriskValue = "*";
 29        private const string AhValue = "Ah";
 30
 31        /// <summary> Tcp. </summary>
 1832        public static SecurityRuleProtocol Tcp { get; } = new SecurityRuleProtocol(TcpValue);
 33        /// <summary> Udp. </summary>
 1834        public static SecurityRuleProtocol Udp { get; } = new SecurityRuleProtocol(UdpValue);
 35        /// <summary> Icmp. </summary>
 036        public static SecurityRuleProtocol Icmp { get; } = new SecurityRuleProtocol(IcmpValue);
 37        /// <summary> Esp. </summary>
 038        public static SecurityRuleProtocol Esp { get; } = new SecurityRuleProtocol(EspValue);
 39        /// <summary> *. </summary>
 640        public static SecurityRuleProtocol Asterisk { get; } = new SecurityRuleProtocol(AsteriskValue);
 41        /// <summary> Ah. </summary>
 042        public static SecurityRuleProtocol Ah { get; } = new SecurityRuleProtocol(AhValue);
 43        /// <summary> Determines if two <see cref="SecurityRuleProtocol"/> values are the same. </summary>
 044        public static bool operator ==(SecurityRuleProtocol left, SecurityRuleProtocol right) => left.Equals(right);
 45        /// <summary> Determines if two <see cref="SecurityRuleProtocol"/> values are not the same. </summary>
 046        public static bool operator !=(SecurityRuleProtocol left, SecurityRuleProtocol right) => !left.Equals(right);
 47        /// <summary> Converts a string to a <see cref="SecurityRuleProtocol"/>. </summary>
 048        public static implicit operator SecurityRuleProtocol(string value) => new SecurityRuleProtocol(value);
 49
 50        /// <inheritdoc />
 51        [EditorBrowsable(EditorBrowsableState.Never)]
 052        public override bool Equals(object obj) => obj is SecurityRuleProtocol other && Equals(other);
 53        /// <inheritdoc />
 3254        public bool Equals(SecurityRuleProtocol other) => string.Equals(_value, other._value, StringComparison.Invariant
 55
 56        /// <inheritdoc />
 57        [EditorBrowsable(EditorBrowsableState.Never)]
 058        public override int GetHashCode() => _value?.GetHashCode() ?? 0;
 59        /// <inheritdoc />
 10460        public override string ToString() => _value;
 61    }
 62}