public static void SBQueue2SBQueue(
     [ServiceBusTrigger(FirstQueueNameKey)] TestPoco[] array,
     ServiceBusMessageActions messageActions)
 {
     string[] messages = array.Select(x => "{'Name': '" + x.Name + "', 'Value': 'Value'}").ToArray();
     ServiceBusMultipleTestJobsBase.ProcessMessages(messages);
 }
 public static void SBQueue2SBQueue(
     [ServiceBusTrigger(FirstQueueName)] TestPoco[] array,
     MessageReceiver messageReceiver)
 {
     Assert.Equal(FirstQueueName, messageReceiver.Path);
     string[] messages = array.Select(x => "{'Name': '" + x.Name + "', 'Value': 'Value'}").ToArray();
     ServiceBusMultipleTestJobsBase.ProcessMessages(messages);
 }
Пример #3
0
 public static void SBQueue2SBQueue(
     [ServiceBusTrigger(FirstQueueNameKey, IsSessionsEnabled = true)]
     ServiceBusReceivedMessage[] array,
     ServiceBusSessionMessageActions messageSession)
 {
     string[] messages = array.Select(x => x.Body.ToString()).ToArray();
     ServiceBusMultipleTestJobsBase.ProcessMessages(messages);
 }
Пример #4
0
 public static void Run(
     [ServiceBusTrigger(FirstQueueNameKey, AutoCompleteMessages = true)]
     ServiceBusReceivedMessage[] array)
 {
     Assert.True(array.Length > 0);
     string[] messages = array.Select(x => x.Body.ToString()).ToArray();
     ServiceBusMultipleTestJobsBase.ProcessMessages(messages);
 }
Пример #5
0
 public static void SBQueue2SBQueue(
     [ServiceBusTrigger(_queueName, IsSessionsEnabled = true)] TestPoco[] array,
     IMessageSession messageSession)
 {
     Assert.Equal(_queueName, messageSession.Path);
     string[] messages = array.Select(x => "{'Name': '" + x.Name + "', 'Value': 'Value'}").ToArray();
     ServiceBusMultipleTestJobsBase.ProcessMessages(messages);
 }
 public static void Run(
     [ServiceBusTrigger(FirstQueueNameKey)]
     ServiceBusReceivedMessage[] array,
     ServiceBusMessageActions messageActions)
 {
     string[] messages = array.Select(x => x.Body.ToString()).ToArray();
     ServiceBusMultipleTestJobsBase.ProcessMessages(messages);
 }
Пример #7
0
 public static void SBQueue2SBQueue(
     [ServiceBusTrigger(FirstQueueNameKey)] ServiceBusReceivedMessage[] array,
     ServiceBusReceiver messageReceiver)
 {
     Assert.AreEqual(_firstQueueScope.QueueName, messageReceiver.EntityPath);
     string[] messages = array.Select(x => x.Body.ToString()).ToArray();
     ServiceBusMultipleTestJobsBase.ProcessMessages(messages);
 }
Пример #8
0
 public static async Task RunAsync(
     [ServiceBusTrigger(FirstQueueNameKey, AutoCompleteMessages = true)]
     ServiceBusReceivedMessage[] array,
     ServiceBusMessageActions messageActions)
 {
     string[] messages = array.Select(x => x.Body.ToString()).ToArray();
     foreach (var msg in array)
     {
         await messageActions.CompleteMessageAsync(msg);
     }
     ServiceBusMultipleTestJobsBase.ProcessMessages(messages);
 }
 public static async Task SBQueue2SBQueue(
     [ServiceBusTrigger(FirstQueueNameKey)] string[] messages,
     ServiceBusMessageActions messageActions, CancellationToken cancellationToken)
 {
     try
     {
         ServiceBusMultipleTestJobsBase.ProcessMessages(messages);
         await Task.Delay(0, cancellationToken);
     }
     catch (OperationCanceledException)
     {
     }
 }
 public static async Task SBQueue2SBQueue(
     [ServiceBusTrigger(FirstQueueName)] string[] messages,
     MessageReceiver messageReceiver, CancellationToken cancellationToken)
 {
     try
     {
         Assert.Equal(FirstQueueName, messageReceiver.Path);
         ServiceBusMultipleTestJobsBase.ProcessMessages(messages);
         await Task.Delay(0, cancellationToken);
     }
     catch (OperationCanceledException)
     {
     }
 }
Пример #11
0
 public static async Task SBQueue2SBQueue(
     [ServiceBusTrigger(_queueName, IsSessionsEnabled = true)] string[] messages,
     IMessageSession messageSession, CancellationToken cancellationToken)
 {
     try
     {
         Assert.Equal(_queueName, messageSession.Path);
         ServiceBusMultipleTestJobsBase.ProcessMessages(messages);
         await Task.Delay(0, cancellationToken);
     }
     catch (OperationCanceledException)
     {
     }
 }
 public static void SBQueue2SBQueue(
     [ServiceBusTrigger(FirstQueueName)] Message[] array,
     MessageReceiver messageReceiver)
 {
     Assert.Equal(FirstQueueName, messageReceiver.Path);
     string[] messages = array.Select(x =>
     {
         using (Stream stream = new MemoryStream(x.Body))
             using (TextReader reader = new StreamReader(stream))
             {
                 return(reader.ReadToEnd());
             }
     }).ToArray();
     ServiceBusMultipleTestJobsBase.ProcessMessages(messages);
 }
Пример #13
0
 public static void SBQueue2SBQueue(
     [ServiceBusTrigger(_queueName, IsSessionsEnabled = true)] Message[] array,
     IMessageSession messageSession)
 {
     Assert.Equal(_queueName, messageSession.Path);
     string[] messages = array.Select(x =>
     {
         using (Stream stream = new MemoryStream(x.Body))
             using (TextReader reader = new StreamReader(stream))
             {
                 return(reader.ReadToEnd());
             }
     }).ToArray();
     ServiceBusMultipleTestJobsBase.ProcessMessages(messages);
 }
            public static async void SBQueue2SBQueue(
                [ServiceBusTrigger(FirstQueueName, AutoComplete = false)] Message[] array,
                MessageReceiver messageReceiver)
            {
                Assert.Equal(FirstQueueName, messageReceiver.Path);
                string[] messages = array.Select(x =>
                {
                    using (Stream stream = new MemoryStream(x.Body))
                        using (TextReader reader = new StreamReader(stream))
                        {
                            return(reader.ReadToEnd());
                        }
                }).ToArray();

                foreach (Message msg in array)
                {
                    // Complete succeeds here, as auto complete is disabled on the function.
                    await messageReceiver.CompleteAsync(msg.SystemProperties.LockToken);
                }

                ServiceBusMultipleTestJobsBase.ProcessMessages(messages);
            }
Пример #15
0
 public static void Run(
     [ServiceBusTrigger(FirstQueueNameKey)]
     ServiceBusReceivedMessage[] array,
     int[] deliveryCountArray,
     string[] lockTokenArray,
     string[] deadLetterSourceArray,
     DateTime[] expiresAtUtcArray,
     DateTime[] enqueuedTimeUtcArray,
     string[] contentTypeArray,
     string[] replyToArray,
     string[] toArray,
     string[] subjectArray,
     string[] labelArray,
     string[] correlationIdArray,
     IDictionary <string, object>[] applicationPropertiesArray,
     IDictionary <string, object>[] userPropertiesArray,
     ServiceBusMessageActions messageActions)
 {
     for (int i = 0; i < array.Length; i++)
     {
         Assert.AreEqual(1, deliveryCountArray[i]);
         Assert.IsNotNull(lockTokenArray[i]);
         Assert.IsNull(deadLetterSourceArray[i]);
         Assert.AreEqual("replyTo", replyToArray[i]);
         Assert.AreEqual("to", toArray[i]);
         Assert.AreEqual("subject", subjectArray[i]);
         Assert.AreEqual("subject", labelArray[i]);
         Assert.AreEqual("correlationId", correlationIdArray[i]);
         Assert.AreEqual("application/json", contentTypeArray[i]);
         Assert.AreEqual("value", applicationPropertiesArray[i]["key"]);
         Assert.AreEqual("value", userPropertiesArray[i]["key"]);
         Assert.IsTrue(expiresAtUtcArray[i] > DateTime.UtcNow);
         Assert.IsTrue(enqueuedTimeUtcArray[i] < DateTime.UtcNow);
     }
     string[] messages = array.Select(x => x.Body.ToString()).ToArray();
     ServiceBusMultipleTestJobsBase.ProcessMessages(messages);
 }
Пример #16
0
 public static void SBQueueFunction2(
     [ServiceBusTrigger(FirstQueueNameKey, IsSessionsEnabled = true)]
     string message)
 {
     ServiceBusMultipleTestJobsBase.ProcessMessages(new string[] { message });
 }