Example #1
0
        public async Task EventHubTriggerCardinalityOne_Succeeds()
        {
            string expectedEventId = Guid.NewGuid().ToString();

            try
            {
                await SetupQueue(Constants.EventHubs.Cardinality_One_Test.OutputName);

                // Need to setup EventHubs: test-inputOne-java and test-outputone-java
                await EventHubsHelpers.SendMessagesAsync(expectedEventId, Constants.EventHubs.Cardinality_One_Test.InputName);

                //Verify
                IEnumerable <string> queueMessages = await StorageHelpers.ReadMessagesFromQueue(Constants.EventHubs.Cardinality_One_Test.OutputName);

                Assert.True(queueMessages.All(msg => msg.Contains(expectedEventId)));
            }
            finally
            {
                //Clear queue
                await StorageHelpers.ClearQueue(Constants.EventHubs.Cardinality_One_Test.OutputName);
            }
        }
Example #2
0
        public async Task EventHubTriggerAndOutputString_Succeeds()
        {
            string expectedEventId = Guid.NewGuid().ToString();

            try
            {
                await SetupQueue(Constants.EventHubs.String_Test.OutputName);

                // Need to setup EventHubs: test-input-one-node
                await EventHubsHelpers.SendMessagesAsync(expectedEventId, Constants.EventHubs.String_Test.InputName);

                //Verify
                var queueMessage = await StorageHelpers.ReadFromQueue(Constants.EventHubs.String_Test.OutputName);

                Assert.Contains(expectedEventId, queueMessage);
            }
            finally
            {
                //Clear queue
                await StorageHelpers.ClearQueue(Constants.EventHubs.String_Test.OutputName);
            }
        }