public static ResourceManagementClient GetResourceManagementClient(MockContext context, RecordedDelegatingHandler handler)
        {
            if (handler != null)
            {
                handler.IsPassThrough = true;
                ResourceManagementClient resourceManagementClient = context.GetServiceClient <ResourceManagementClient>(handlers: handler);

                // By default test framework sets this to 0 during playback, and during record mode it uses default client timeout sets by the generated code
                // If you want to change that time out during recording, please use HttpMockServer.Mode to detect Record/Playback
                // Tests execution should not take more than 1 second during playback.
                //resourceManagementClient.LongRunningOperationRetryTimeout = 5;
                return(resourceManagementClient);
            }

            return(null);
        }
        public static EventGridClient GetEventGridClient(MockContext context, ResourceCredentials credentials, RecordedDelegatingHandler handler)
        {
            if (handler != null)
            {
                handler.IsPassThrough = true;
                TestEnvironment testEnvironment = TestEnvironmentFactory.GetTestEnvironment();
                EventGridClient eventGridClient = context.GetServiceClientWithCredentials <EventGridClient>(testEnvironment, credentials, true, handler);
                return(eventGridClient);
            }

            return(null);
        }