public static void Init(TestContext context)
        {
            // Wire up test secrets.
            _secrets = TestsBase.InitSecrets();

            // Get a data client, helping us actually Read data, too.
            _dataClient = LawDataClientHelper.GetLawDataClient(
                _secrets.LawSecrets.LawId,
                _secrets.LawPrincipalCredentials.ClientId,
                _secrets.LawPrincipalCredentials.ClientSecret,
                _secrets.LawPrincipalCredentials.Domain)
                          .Result;

            // Set up unique identifiers for the tests. This helps us query the Log Analytics Workspace for our specific messages, and ensure the count and properties are correctly shipped to the logs.
            testIdentifierEntries       = $"test-id-{Guid.NewGuid()}";
            testIdentifierEntry         = $"test-id-{Guid.NewGuid()}";
            testIdentifierEncodingEntry = $"test-id-{Guid.NewGuid()}-ÅÄÖ@~#$%^&*()123";
            testIdentifierNullableEntry = $"test-id-{Guid.NewGuid()}";
            testIdentifierLogTypeEntry  = $"test-id-{Guid.NewGuid()}";
            diTestId = $"test-id-di-{Guid.NewGuid()}";


            // Initialize the LAW Client.
            LogAnalyticsClient logger = new LogAnalyticsClient(
                workspaceId: _secrets.LawSecrets.LawId,
                sharedKey: _secrets.LawSecrets.LawKey);

            // Test 1 prep: Push a collection of entities to the logs.
            List <DemoEntity> entities = new List <DemoEntity>();

            for (int ii = 0; ii < 12; ii++)
            {
                entities.Add(new DemoEntity
                {
                    Criticality  = "e2ecriticality",
                    Message      = testIdentifierEntries,
                    SystemSource = "e2etest",
                    Priority     = int.MaxValue - 1
                });
            }
            logger.SendLogEntries(entities, "endtoendlogs").Wait();


            // Test 2 prep: Send a single entry to the logs.
            logger.SendLogEntry(new DemoEntity
            {
                Criticality  = "e2ecriticalitysingleentry",
                Message      = testIdentifierEntry,
                SystemSource = "e2etestsingleentry",
                Priority     = int.MinValue + 1
            }, "endtoendlogs");

            // Since it takes a while before the logs are queryable, we'll sit tight and wait for a few minutes before we launch the retrieval-tests.

            // Test 3 prep: Verify that different encoding types work
            var encodingTestEntity = new DemoEntity
            {
                Criticality  = "e2ecriticalityencoding",
                Message      = $"{testIdentifierEncodingEntry}", // Special encoding test.
                SystemSource = "e2etestencoding",
                Priority     = int.MaxValue - 10000
            };

            logger.SendLogEntry(encodingTestEntity, "endtoendlogs");

            // Test 4 prep: Verify that nullable entries work
            var nullableTestEntity = new NullableDemoEntity
            {
                Message   = $"{testIdentifierNullableEntry}",
                NoValue   = null,
                WithValue = int.MaxValue - 20000
            };

            logger.SendLogEntry(nullableTestEntity, "endtoendlogs");


            // Test 5 prep: Verify we can use AlphaNum + Underscore for Log-Type.
            var logTypeTestEntity = new DemoEntity
            {
                Criticality  = "Critical",
                Message      = testIdentifierLogTypeEntry,
                Priority     = int.MaxValue - 1,
                SystemSource = "logtypetest"
            };

            logger.SendLogEntry(logTypeTestEntity, "log_name_123");

            //
            // DI LOGGER
            //
            var provider = new ServiceCollection()
                           .AddLogAnalyticsClient(c =>
            {
                c.WorkspaceId = _secrets.LawSecrets.LawId;
                c.SharedKey   = _secrets.LawSecrets.LawKey;
            }).BuildServiceProvider();

            var diLogger = provider.GetRequiredService <LogAnalyticsClient>();

            // Send a log entry to verify it works.
            diLogger.SendLogEntry(new DemoEntity
            {
                Criticality  = "e2ecritical",
                Message      = diTestId,
                SystemSource = "e2ewithdi",
                Priority     = int.MinValue + 1
            }, "endtoendwithdilogs");


            // Unfortunately, from the time we send the logs, until they appear in LAW, takes a few minutes.
            Thread.Sleep(8 * 1000 * 60);
        }
        public static void Init(TestContext context)
        {
            // Wire up test secrets.
            _secrets = InitSecrets();

            // Get a data client, helping us actually Read data, too.
            _dataClient = GetLawDataClient(
                _secrets.LawSecrets.LawId,
                _secrets.LawPrincipalCredentials.ClientId,
                _secrets.LawPrincipalCredentials.ClientSecret,
                _secrets.LawPrincipalCredentials.Domain)
                          .Result;

            // Set up unique identifiers for the tests. This helps us query the Log Analytics Workspace for our specific messages, and ensure the count and properties are correctly shipped to the logs.
            testIdentifierEntries       = $"test-id-{Guid.NewGuid()}";
            testIdentifierEntry         = $"test-id-{Guid.NewGuid()}";
            testIdentifierEncodingEntry = $"test-id-{Guid.NewGuid()}-ÅÄÖ@~#$%^&*()123";
            testIdentifierNullableEntry = $"test-id-{Guid.NewGuid()}";

            // Initialize the LAW Client.
            LogAnalyticsClient logger = new LogAnalyticsClient(
                workspaceId: _secrets.LawSecrets.LawId,
                sharedKey: _secrets.LawSecrets.LawKey);

            // Test 1 prep: Push a collection of entities to the logs.
            List <DemoEntity> entities = new List <DemoEntity>();

            for (int ii = 0; ii < 12; ii++)
            {
                entities.Add(new DemoEntity
                {
                    Criticality  = "e2ecriticality",
                    Message      = testIdentifierEntries,
                    SystemSource = "e2etest",
                    Priority     = int.MaxValue - 1
                });
            }
            logger.SendLogEntries(entities, "endtoendlogs").Wait();


            // Test 2 prep: Send a single entry to the logs.
            logger.SendLogEntry(new DemoEntity
            {
                Criticality  = "e2ecriticalitysingleentry",
                Message      = testIdentifierEntry,
                SystemSource = "e2etestsingleentry",
                Priority     = int.MinValue + 1
            }, "endtoendlogs");

            // Since it takes a while before the logs are queryable, we'll sit tight and wait for a few minutes before we launch the retrieval-tests.

            // Test 3 prep: Verify that different encoding types work
            var encodingTestEntity = new DemoEntity
            {
                Criticality  = "e2ecriticalityencoding",
                Message      = $"{testIdentifierEncodingEntry}", // Special encoding test.
                SystemSource = "e2etestencoding",
                Priority     = int.MaxValue - 10000
            };

            logger.SendLogEntry(encodingTestEntity, "endtoendlogs");

            // Test 4 prep: Verify that nullable entries work
            var nullableTestEntity = new NullableDemoEntity
            {
                Message   = $"{testIdentifierNullableEntry}",
                NoValue   = null,
                WithValue = int.MaxValue - 20000
            };

            logger.SendLogEntry(nullableTestEntity, "endtoendlogs");


            Thread.Sleep(6 * 1000 * 60);
        }