Exemplo n.º 1
0
 internal UnitTestingRemoteHostClient(
     ServiceHubRemoteHostClient client,
     UnitTestingServiceDescriptorsWrapper serviceDescriptors,
     UnitTestingRemoteServiceCallbackDispatcherRegistry callbackDispatchers
     )
 {
     _client              = client;
     _serviceDescriptors  = serviceDescriptors;
     _callbackDispatchers = callbackDispatchers;
 }
Exemplo 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
                       ));
        }