Esempio n. 1
0
 internal UnitTestingRemoteHostClient(
     ServiceHubRemoteHostClient client,
     UnitTestingServiceDescriptorsWrapper serviceDescriptors,
     UnitTestingRemoteServiceCallbackDispatcherRegistry callbackDispatchers
     )
 {
     _client              = client;
     _serviceDescriptors  = serviceDescriptors;
     _callbackDispatchers = callbackDispatchers;
 }
Esempio n. 2
0
        public static async Task <UnitTestingRemoteHostClient?> TryGetClientAsync(
            HostWorkspaceServices services,
            UnitTestingServiceDescriptorsWrapper serviceDescriptors,
            UnitTestingRemoteServiceCallbackDispatcherRegistry callbackDispatchers,
            CancellationToken cancellationToken = default
            )
        {
            var client = await RemoteHostClient
                         .TryGetClientAsync(services, cancellationToken)
                         .ConfigureAwait(false);

            if (client is null)
            {
                return(null);
            }

            return(new UnitTestingRemoteHostClient(
                       (ServiceHubRemoteHostClient)client,
                       serviceDescriptors,
                       callbackDispatchers
                       ));
        }