< Summary

Class:Azure.Messaging.EventGrid.SystemEvents.AppAction
Assembly:Azure.Messaging.EventGrid
File(s):C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\AppAction.cs
Covered lines:2
Uncovered lines:13
Coverable lines:15
Total lines:63
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_Restarted()-0%100%
get_Stopped()-0%100%
get_ChangedAppSettings()-0%100%
get_Started()-0%100%
get_Completed()-0%100%
get_Failed()-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\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\AppAction.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.Messaging.EventGrid.SystemEvents
 12{
 13    /// <summary> Type of action of the operation. </summary>
 14    public readonly partial struct AppAction : IEquatable<AppAction>
 15    {
 16        private readonly string _value;
 17
 18        /// <summary> Determines if two <see cref="AppAction"/> values are the same. </summary>
 19        /// <exception cref="ArgumentNullException"> <paramref name="value"/> is null. </exception>
 20        public AppAction(string value)
 21        {
 2422            _value = value ?? throw new ArgumentNullException(nameof(value));
 2423        }
 24
 25        private const string RestartedValue = "Restarted";
 26        private const string StoppedValue = "Stopped";
 27        private const string ChangedAppSettingsValue = "ChangedAppSettings";
 28        private const string StartedValue = "Started";
 29        private const string CompletedValue = "Completed";
 30        private const string FailedValue = "Failed";
 31
 32        /// <summary> Web app was restarted. </summary>
 033        public static AppAction Restarted { get; } = new AppAction(RestartedValue);
 34        /// <summary> Web app was stopped. </summary>
 035        public static AppAction Stopped { get; } = new AppAction(StoppedValue);
 36        /// <summary> There was an operation to change app setting on the web app. </summary>
 037        public static AppAction ChangedAppSettings { get; } = new AppAction(ChangedAppSettingsValue);
 38        /// <summary> The job has started. </summary>
 039        public static AppAction Started { get; } = new AppAction(StartedValue);
 40        /// <summary> The job has completed. </summary>
 041        public static AppAction Completed { get; } = new AppAction(CompletedValue);
 42        /// <summary> The job has failed to complete. </summary>
 043        public static AppAction Failed { get; } = new AppAction(FailedValue);
 44        /// <summary> Determines if two <see cref="AppAction"/> values are the same. </summary>
 045        public static bool operator ==(AppAction left, AppAction right) => left.Equals(right);
 46        /// <summary> Determines if two <see cref="AppAction"/> values are not the same. </summary>
 047        public static bool operator !=(AppAction left, AppAction right) => !left.Equals(right);
 48        /// <summary> Converts a string to a <see cref="AppAction"/>. </summary>
 049        public static implicit operator AppAction(string value) => new AppAction(value);
 50
 51        /// <inheritdoc />
 52        [EditorBrowsable(EditorBrowsableState.Never)]
 053        public override bool Equals(object obj) => obj is AppAction other && Equals(other);
 54        /// <inheritdoc />
 055        public bool Equals(AppAction other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgno
 56
 57        /// <inheritdoc />
 58        [EditorBrowsable(EditorBrowsableState.Never)]
 059        public override int GetHashCode() => _value?.GetHashCode() ?? 0;
 60        /// <inheritdoc />
 061        public override string ToString() => _value;
 62    }
 63}