private async Task ValidateEvent(string deviceId, string eventId, string payload, string p1Value,
                                         EventHubTestListener testListener, AzureSecurityCenterForIoTLogAnalyticsClient logAnalticsTestClient)
        {
            bool isReceivedEventHub = await testListener.WaitForMessage(deviceId, payload, p1Value).ConfigureAwait(false);

            Assert.IsFalse(isReceivedEventHub, "Security message received in customer event hub.");
            bool isReceivedOms = await logAnalticsTestClient.IsRawEventExist(deviceId, eventId).ConfigureAwait(false);

            Assert.IsTrue(isReceivedOms, "Security message was not recived in customer log analytics");
        }
 private async Task ValidateEventAsync(
     string deviceId,
     string eventId,
     string payload,
     string p1Value,
     AzureSecurityCenterForIoTLogAnalyticsClient logAnalticsTestClient)
 {
     bool isReceivedEventHub = EventHubTestListener.VerifyIfMessageIsReceived(deviceId, payload, p1Value, TimeSpan.FromSeconds(10));
     Assert.IsFalse(isReceivedEventHub, "Security message received in customer event hub.");
     bool isReceivedOms = await logAnalticsTestClient.IsRawEventExist(deviceId, eventId).ConfigureAwait(false);
     Assert.IsTrue(isReceivedOms, "Security message was not received in customer log analytics");
 }