Share via


BrokeredServiceContractTestBase<TInterface,TServiceMock> Class

Definition

A base class for testing Visual Studio brokered service contracts.

public abstract class BrokeredServiceContractTestBase<TInterface,TServiceMock> : Microsoft.VisualStudio.Sdk.TestFramework.LoggingTestBase, Xunit.IAsyncLifetime where TInterface : class where TServiceMock : TInterface, new()
type BrokeredServiceContractTestBase<'Interface, #'Interface (requires 'Interface : null)> = class
    inherit LoggingTestBase
    interface IAsyncLifetime
Public MustInherit Class BrokeredServiceContractTestBase(Of TInterface, TServiceMock)
Inherits LoggingTestBase
Implements IAsyncLifetime

Type Parameters

TInterface

The service interface.

TServiceMock

The class that mocks the service.

Inheritance
BrokeredServiceContractTestBase<TInterface,TServiceMock>
Implements
Xunit.IAsyncLifetime

Constructors

BrokeredServiceContractTestBase<TInterface,TServiceMock>(ITestOutputHelper, ServiceRpcDescriptor)

Initializes a new instance of the BrokeredServiceContractTestBase<TInterface,TServiceMock> class.

Properties

ClientProxy

Gets or sets the client proxy the test will use to interact with the mock Service.

DefaultTestsEnabled

Gets or sets a value indicating whether convention tests defined on the BrokeredServiceContractTestBase<TInterface,TServiceMock> base class should run as part of the derived test class.

Descriptor

Gets the descriptor that the product will use to request or proffer the brokered service.

DescriptorLoggingVerbosity

Gets or sets the verbosity level to use for logging messages related to the RPC calls between client and service.

ExpectedTimeout

Gets a reasonably short time period to wait where a timeout is expected.

(Inherited from TestBase)
ExpectedTimeoutToken

Gets a newly initialized CancellationToken that is canceled after ExpectedTimeout expires from the time this property is retrieved.

(Inherited from TestBase)
Logger

Gets the logger for the current.

(Inherited from LoggingTestBase)
MultiplexingLoggingVerbosity

Gets or sets the verbosity level to use for logging messages related to the Nerdbank.Streams.MultiplexingStream.

Service

Gets or sets the mock service implementation.

TestStopwatch

Gets a stopwatch that is started when the test class is instantiated.

(Inherited from TestBase)
TimeoutToken

Gets a token that gets canceled UnexpectedTimeout after the test class is instantiated.

(Inherited from TestBase)
UnexpectedTimeout

Gets a reasonably long time period to wait where we expect some other event to occur rather than normal test execution waiting this whole time period.

(Inherited from TestBase)
UnexpectedTimeoutToken

Gets a newly initialized CancellationToken that is canceled after UnexpectedTimeout expires from the time this property is retrieved.

(Inherited from TestBase)

Methods

AllMethodsIncludeCancellationToken()

Verifies that all methods on the service interface include a CancellationToken as the last parameter.

AssertEventRaisedAsync(Action<TInterface,EventHandler>, Action<TInterface,EventHandler>, Action<TServiceMock>)

Asserts that an event is raised with expected data.

AssertEventRaisedAsync<TEventArgs>(Action<TInterface,EventHandler<TEventArgs>>, Action<TInterface,EventHandler<TEventArgs>>, Action<TServiceMock>, Action<TEventArgs>)

Asserts that an event is raised with expected data.

Dispose() (Inherited from TestBase)
Dispose(Boolean)

Disposes of managed and unmanaged resources owned by this object.

(Inherited from LoggingTestBase)
DisposeAsync() Xunit.IAsyncLifetime.DisposeAsync
InitializeAsync() Xunit.IAsyncLifetime.InitializeAsync

Applies to