MockBrokeredServiceContainer Class

Definition

A mock implementation of IBrokeredServiceContainer suitable for unit tests.

public ref class MockBrokeredServiceContainer : Microsoft::VisualStudio::Utilities::ServiceBroker::GlobalBrokeredServiceContainer
public class MockBrokeredServiceContainer : Microsoft.VisualStudio.Utilities.ServiceBroker.GlobalBrokeredServiceContainer
type MockBrokeredServiceContainer = class
    inherit GlobalBrokeredServiceContainer
Public Class MockBrokeredServiceContainer
Inherits GlobalBrokeredServiceContainer
Inheritance
MockBrokeredServiceContainer

Remarks

This container does not require advance service registration. When a service is proffered, registration is automatically synthesized if necessary, exposing the service with Local.

Constructors

MockBrokeredServiceContainer(TraceSource)

Initializes a new instance of the MockBrokeredServiceContainer class with no JoinableTaskFactory or TelemetrySession. A mock authorization service is installed that approves every request.

Properties

LocalUserCredentials

Gets credentials to use to impersonate the local user.

RegisteredServices

Gets the services currently registered.

(Inherited from GlobalBrokeredServiceContainer)

Methods

ApplyChaosMonkeyConfigurationAsync(String, CancellationToken)
Obsolete.

Loads and applies the content of a chaos monkey configuration.

(Inherited from GlobalBrokeredServiceContainer)
ExportDiagnosticsAsync(String, ServiceAudience, CancellationToken)

Writes a bunch of diagnostic data to a JSON file.

(Inherited from GlobalBrokeredServiceContainer)
GetFullAccessServiceBroker()

Gets an IServiceBroker with full access to all services available to this process with local credentials applied by default for all service requests. This should not be used within a brokered service, which should instead use the IServiceBroker that is given to its service factory.

(Inherited from GlobalBrokeredServiceContainer)
GetLimitedAccessRemoteServiceBroker(ServiceAudience, IReadOnlyDictionary<String,String>, ClientCredentialsPolicy) (Inherited from GlobalBrokeredServiceContainer)
GetLimitedAccessServiceBroker(ServiceAudience, IReadOnlyDictionary<String,String>, ClientCredentialsPolicy)

Gets a service broker that targets an out of proc and/or less trusted consumer.

(Inherited from GlobalBrokeredServiceContainer)
GetSecureServiceBroker(ServiceActivationOptions)

Gets a service broker that may be provided to a BrokeredServiceFactory in order to automatically propagate ClientCredentials from one service to its dependencies.

(Inherited from GlobalBrokeredServiceContainer)
GetServicesThatMayBeExpected(ServiceSource)

Returns the services that are registered locally that may be proffered by a particular remote source.

(Inherited from GlobalBrokeredServiceContainer)
GetTraceSourceForBrokeredServiceAsync(IServiceBroker, ServiceMoniker, ServiceActivationOptions, Boolean, CancellationToken)

Gets a TraceSource to apply to some brokered service.

(Inherited from GlobalBrokeredServiceContainer)
GetTraceSourceForConnectionAsync(IServiceBroker, ServiceMoniker, ServiceActivationOptions, Boolean, CancellationToken)

Gets a TraceSource to apply to some brokered service.

(Inherited from GlobalBrokeredServiceContainer)
Proffer(GlobalBrokeredServiceContainer+IProffered)

Indexes a proffered service factory or broker for fast lookup.

Proffer(IServiceBroker, IReadOnlyCollection<ServiceMoniker>)

Proffers services from another IServiceBroker into this container.

(Inherited from GlobalBrokeredServiceContainer)
Proffer(ServiceRpcDescriptor, AuthorizingBrokeredServiceFactory)

Proffers a service for publication via an IServiceBroker associated with this container.

(Inherited from GlobalBrokeredServiceContainer)
Proffer(ServiceRpcDescriptor, BrokeredServiceFactory)

Proffers a service for publication via an IServiceBroker associated with this container.

(Inherited from GlobalBrokeredServiceContainer)
ProfferIntrinsicService(ServiceRpcDescriptor, ServiceRegistration, BrokeredServiceFactory)

Proffers a new Intrinsic service. Should only be accessible to derived classes.

(Inherited from GlobalBrokeredServiceContainer)
ProfferRemoteBroker(IRemoteServiceBroker, ServiceSource, ImmutableHashSet<ServiceMoniker>)

Proffers services offered by a remote IRemoteServiceBroker for access by this container.

(Inherited from GlobalBrokeredServiceContainer)
ProfferRemoteBroker(IServiceBroker, ServiceSource, ImmutableHashSet<ServiceMoniker>)

Proffers services offered by a remote IServiceBroker for access by this container.

(Inherited from GlobalBrokeredServiceContainer)
RegisterServices(IReadOnlyDictionary<ServiceMoniker,ServiceRegistration>)

Registers a set of services with the global broker. This is separate from proffering a service. A service should be registered before it is proffered. An AvailabilityChanged event is never fired as a result of calling this method, but instead will be fired once the service is proffered.

(Inherited from GlobalBrokeredServiceContainer)
UnregisterServices(IEnumerable<ServiceMoniker>)

Unregisters a set of services with the global broker. This is separate from unproffering a service. A service should be unregistered before it is unproffered. An AvailabilityChanged event is never fired as a result of calling this method, but instead will be fired once the service is unproffered. To unproffer a service, simply dispose of it's proffering source.

(Inherited from GlobalBrokeredServiceContainer)

Applies to