< Summary

Class:Azure.ResourceManager.Compute.Models.DiskState
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\DiskState.cs
Covered lines:2
Uncovered lines:13
Coverable lines:15
Total lines:62
Line coverage:13.3% (2 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_Unattached()-0%100%
get_Attached()-0%100%
get_Reserved()-0%100%
get_ActiveSAS()-0%100%
get_ReadyToUpload()-0%100%
get_ActiveUpload()-0%100%
op_Equality(...)-0%100%
op_Inequality(...)-0%100%
op_Implicit(...)-0%100%
Equals(...)-0%0%
Equals(...)-0%100%
GetHashCode()-0%0%
ToString()-0%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\DiskState.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.Compute.Models
 12{
 13    /// <summary> The state of the disk. </summary>
 14    public readonly partial struct DiskState : IEquatable<DiskState>
 15    {
 16        private readonly string _value;
 17
 18        /// <summary> Determines if two <see cref="DiskState"/> values are the same. </summary>
 19        public DiskState(string value)
 20        {
 22821            _value = value ?? throw new ArgumentNullException(nameof(value));
 22822        }
 23
 24        private const string UnattachedValue = "Unattached";
 25        private const string AttachedValue = "Attached";
 26        private const string ReservedValue = "Reserved";
 27        private const string ActiveSASValue = "ActiveSAS";
 28        private const string ReadyToUploadValue = "ReadyToUpload";
 29        private const string ActiveUploadValue = "ActiveUpload";
 30
 31        /// <summary> The disk is not being used and can be attached to a VM. </summary>
 032        public static DiskState Unattached { get; } = new DiskState(UnattachedValue);
 33        /// <summary> The disk is currently mounted to a running VM. </summary>
 034        public static DiskState Attached { get; } = new DiskState(AttachedValue);
 35        /// <summary> The disk is mounted to a stopped-deallocated VM. </summary>
 036        public static DiskState Reserved { get; } = new DiskState(ReservedValue);
 37        /// <summary> The disk currently has an Active SAS Uri associated with it. </summary>
 038        public static DiskState ActiveSAS { get; } = new DiskState(ActiveSASValue);
 39        /// <summary> A disk is ready to be created by upload by requesting a write token. </summary>
 040        public static DiskState ReadyToUpload { get; } = new DiskState(ReadyToUploadValue);
 41        /// <summary> A disk is created for upload and a write token has been issued for uploading to it. </summary>
 042        public static DiskState ActiveUpload { get; } = new DiskState(ActiveUploadValue);
 43        /// <summary> Determines if two <see cref="DiskState"/> values are the same. </summary>
 044        public static bool operator ==(DiskState left, DiskState right) => left.Equals(right);
 45        /// <summary> Determines if two <see cref="DiskState"/> values are not the same. </summary>
 046        public static bool operator !=(DiskState left, DiskState right) => !left.Equals(right);
 47        /// <summary> Converts a string to a <see cref="DiskState"/>. </summary>
 048        public static implicit operator DiskState(string value) => new DiskState(value);
 49
 50        /// <inheritdoc />
 51        [EditorBrowsable(EditorBrowsableState.Never)]
 052        public override bool Equals(object obj) => obj is DiskState other && Equals(other);
 53        /// <inheritdoc />
 054        public bool Equals(DiskState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgno
 55
 56        /// <inheritdoc />
 57        [EditorBrowsable(EditorBrowsableState.Never)]
 058        public override int GetHashCode() => _value?.GetHashCode() ?? 0;
 59        /// <inheritdoc />
 060        public override string ToString() => _value;
 61    }
 62}