< Summary

Class:Azure.Response`1
Assembly:Azure.Core
File(s):C:\Git\azure-sdk-for-net\sdk\core\Azure.Core\src\Response{T}.cs
Covered lines:2
Uncovered lines:2
Coverable lines:4
Total lines:47
Line coverage:50% (2 of 4)
Covered branches:0
Total branches:0

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
op_Implicit(...)-100%100%
Equals(...)-0%100%
GetHashCode()-0%100%
ToString()-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\core\Azure.Core\src\Response{T}.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4using System.ComponentModel;
 5using System.Diagnostics;
 6
 7namespace Azure
 8{
 9    /// <summary>
 10    /// Represents a result of Azure operation.
 11    /// </summary>
 12    /// <typeparam name="T">The type of returned value.</typeparam>
 13    [DebuggerTypeProxy(typeof(ResponseDebugView<>))]
 14    public abstract class Response<T>
 15    {
 16        /// <summary>
 17        /// Returns the HTTP response returned by the service.
 18        /// </summary>
 19        /// <returns>The HTTP response returned by the service.</returns>
 20        public abstract Response GetRawResponse();
 21
 22        /// <summary>
 23        /// Gets the value returned by the service.
 24        /// </summary>
 25        public abstract T Value { get; }
 26
 27        /// <summary>
 28        /// Returns the value of this <see cref="Response{T}"/> object.
 29        /// </summary>
 30        /// <param name="response">The <see cref="Response{T}"/> instance.</param>
 631        public static implicit operator T(Response<T> response) => response.Value;
 32
 33        /// <inheritdoc />
 34        [EditorBrowsable(EditorBrowsableState.Never)]
 035        public override bool Equals(object? obj) => base.Equals(obj);
 36
 37        /// <inheritdoc />
 38        [EditorBrowsable(EditorBrowsableState.Never)]
 039        public override int GetHashCode() => base.GetHashCode();
 40
 41        /// <inheritdoc />
 42        public override string ToString()
 43        {
 244            return $"Status: {GetRawResponse().Status}, Value: {Value}";
 45        }
 46    }
 47}