Exemplo n.º 1
0
        private async Task ValidateEventAsync(
            string deviceId,
            string eventId,
            AzureSecurityCenterForIoTLogAnalyticsClient logAnalticsTestClient)
        {
            bool isReceivedOms = await logAnalticsTestClient.IsRawEventExist(deviceId, eventId).ConfigureAwait(false);

            Assert.IsTrue(isReceivedOms, "Security message was not received in customer log analytics");
        }
Exemplo n.º 2
0
        private async Task SendSingleSecurityMessageModuleAsync(
            ModuleClient moduleClient,
            string deviceId,
            AzureSecurityCenterForIoTLogAnalyticsClient logAnalticsTestClient)
        {
            await moduleClient.OpenAsync().ConfigureAwait(false);

            Client.Message testMessage = ComposeD2CSecurityTestMessage(out string eventId, out _, out _);
            await moduleClient.SendEventAsync(testMessage).ConfigureAwait(false);

            await ValidateEventAsync(deviceId, eventId, logAnalticsTestClient).ConfigureAwait(false);
        }
Exemplo n.º 3
0
 public AzureSecurityCenterForIoTSecurityMessageE2ETests()
 {
     _logAnalyticsClient = AzureSecurityCenterForIoTLogAnalyticsClient.CreateClient();
 }