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-powershell and test-outputone-powershell 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); } }
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-ps 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); } }