< Summary

Class:Azure.Messaging.ServiceBus.Amqp.AmqpRequestMessage
Assembly:Azure.Messaging.ServiceBus
File(s):C:\Git\azure-sdk-for-net\sdk\servicebus\Azure.Messaging.ServiceBus\src\Amqp\AmqpRequestMessage.cs
Covered lines:0
Uncovered lines:10
Coverable lines:10
Total lines:31
Line coverage:0% (0 of 10)
Covered branches:0
Total branches:2
Branch coverage:0% (0 of 2)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
get_AmqpMessage()-0%100%
get_Map()-0%100%
CreateRequest(...)-0%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\servicebus\Azure.Messaging.ServiceBus\src\Amqp\AmqpRequestMessage.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4using System;
 5using Microsoft.Azure.Amqp;
 6using Microsoft.Azure.Amqp.Encoding;
 7using Microsoft.Azure.Amqp.Framing;
 8
 9namespace Azure.Messaging.ServiceBus.Amqp
 10{
 11    internal sealed class AmqpRequestMessage
 12    {
 013        public AmqpRequestMessage(string operation, TimeSpan timeout, string trackingId)
 14        {
 015            Map = new AmqpMap();
 016            AmqpMessage = AmqpMessage.Create(new AmqpValue { Value = Map });
 017            AmqpMessage.ApplicationProperties.Map[ManagementConstants.Request.Operation] = operation;
 018            AmqpMessage.ApplicationProperties.Map[ManagementConstants.Properties.ServerTimeout] = (uint)timeout.TotalMil
 019            AmqpMessage.ApplicationProperties.Map[ManagementConstants.Properties.TrackingId] = trackingId ?? Guid.NewGui
 020        }
 21
 022        public AmqpMessage AmqpMessage { get; }
 23
 024        public AmqpMap Map { get; }
 25
 26        public static AmqpRequestMessage CreateRequest(string operation, TimeSpan timeout, string trackingId)
 27        {
 028            return new AmqpRequestMessage(operation, timeout, trackingId);
 29        }
 30    }
 31}