< Summary

Class:Azure.Messaging.EventHubs.AmqpResponse
Assembly:Azure.Messaging.EventHubs
File(s):C:\Git\azure-sdk-for-net\sdk\eventhub\Azure.Messaging.EventHubs\src\Amqp\AmqpResponse.cs
Covered lines:1
Uncovered lines:0
Coverable lines:1
Total lines:36
Line coverage:100% (1 of 1)
Covered branches:2
Total branches:2
Branch coverage:100% (2 of 2)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
IsSuccessStatus(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\eventhub\Azure.Messaging.EventHubs\src\Amqp\AmqpResponse.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4using Microsoft.Azure.Amqp;
 5
 6namespace Azure.Messaging.EventHubs
 7{
 8    /// <summary>
 9    ///   The set of annotations for service responses associated with an AMQP messages and
 10    ///   entities.
 11    /// </summary>
 12    ///
 13    internal static class AmqpResponse
 14    {
 15        /// <summary>The annotation that identifies the code of a response status.</summary>
 16        public const string StatusCode = "status-code";
 17
 18        /// <summary>The annotation that identifies the description of a response status.</summary>
 19        public const string StatusDescription = "status-description";
 20
 21        /// <summary>The annotation that identifies an error response.</summary>
 22        public const string ErrorCondition = "error-condition";
 23
 24        /// <summary>
 25        ///   Determines whether the given AMQP status code value should be considered a successful
 26        ///   request.
 27        /// </summary>
 28        ///
 29        /// <param name="statusCode">The status code value to consider.</param>
 30        ///
 31        /// <returns><c>true</c> if the request should be considered successful; otherwise, <c>false</c>.</returns>
 32        ///
 33        public static bool IsSuccessStatus(AmqpResponseStatusCode statusCode) =>
 2234            ((statusCode == AmqpResponseStatusCode.OK) || (statusCode == AmqpResponseStatusCode.Accepted));
 35    }
 36}

Methods/Properties

IsSuccessStatus(...)