Show / Hide Table of Contents

    Class TestHarness

    Provides capabilities to test services in an isolated runtime.

    Inheritance
    System.Object
    TestHarness
    Implements
    System.IDisposable
    Namespace: Copper.Testing.Harness
    Assembly: Copper.Testing.dll
    Syntax
    public class TestHarness : IDisposable

    Constructors

    View Source

    TestHarness(IEnumerable<FabricHost>, ServiceProxy, EventsProxy, EventSubscriptionService, IEnumerable<EventHandler>)

    Initializes a new instance of the TestHarness class.

    Declaration
    public TestHarness(IEnumerable<FabricHost> fabricHosts, ServiceProxy serviceProxy, EventsProxy eventsProxy, EventSubscriptionService eventSubscriptionService, IEnumerable<EventHandler> eventHandlers = null)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<FabricHost> fabricHosts

    The fabric hosts to run.

    ServiceProxy serviceProxy

    The service proxy, used to communicate with services.

    EventsProxy eventsProxy

    The events proxy, used to publish events.

    EventSubscriptionService eventSubscriptionService

    The event subscription service, used to subscribe to events.

    System.Collections.Generic.IEnumerable<EventHandler> eventHandlers

    The event handlers to be subscribed.

    Methods

    View Source

    Dispose()

    Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

    Declaration
    public void Dispose()
    View Source

    Dispose(Boolean)

    Releases unmanaged and - optionally - managed resources.

    Declaration
    protected virtual void Dispose(bool disposing)
    Parameters
    Type Name Description
    System.Boolean disposing

    true to release both managed and unmanaged resources; false to release only unmanaged resources.

    View Source

    Run()

    Runs the test harness, running the configured fabric hosts and subscribing the configured event handlers.

    Declaration
    public void Run()
    View Source

    RunAsync()

    Runs the test harness, running the configured fabric hosts and subscribing the configured event handlers.

    Declaration
    public async Task RunAsync()
    Returns
    Type Description
    System.Threading.Tasks.Task
    View Source

    TestService<TContract>(IRequestSubmitterFactory, Func<TContract, Task>)

    Tests the service by running the provided scenario.

    Declaration
    public async Task TestService<TContract>(IRequestSubmitterFactory requestSubmitterFactory, Func<TContract, Task> scenario)
        where TContract : class
    Parameters
    Type Name Description
    IRequestSubmitterFactory requestSubmitterFactory

    The request submitter factory.

    System.Func<TContract, System.Threading.Tasks.Task> scenario

    The scenario.

    Returns
    Type Description
    System.Threading.Tasks.Task
    Type Parameters
    Name Description
    TContract

    The contract type.

    View Source

    TestService<TContract>(RequestSubmitterBuilder, Func<TContract, Task>)

    Tests the service by running the provided scenario.

    Declaration
    public async Task TestService<TContract>(RequestSubmitterBuilder requestSubmitterBuilder, Func<TContract, Task> scenario)
        where TContract : class
    Parameters
    Type Name Description
    RequestSubmitterBuilder requestSubmitterBuilder

    The request submitter builder.

    System.Func<TContract, System.Threading.Tasks.Task> scenario

    The scenario.

    Returns
    Type Description
    System.Threading.Tasks.Task
    Type Parameters
    Name Description
    TContract

    The contract type.

    View Source

    TestServiceEvents<TContract>(EventPublisherBuilder, Func<TContract, Task>)

    Tests the impact of a published event by running the provided scenario.

    Declaration
    public async Task TestServiceEvents<TContract>(EventPublisherBuilder eventPublisherBuilder, Func<TContract, Task> scenario)
        where TContract : class
    Parameters
    Type Name Description
    EventPublisherBuilder eventPublisherBuilder

    The event publisher builder.

    System.Func<TContract, System.Threading.Tasks.Task> scenario

    The scenario.

    Returns
    Type Description
    System.Threading.Tasks.Task
    Type Parameters
    Name Description
    TContract

    The contract type.

    View Source

    TestServiceEvents<TContract>(IEventPublisherFactory, Func<TContract, Task>)

    Tests the impact of a published event by running the provided scenario.

    Declaration
    public async Task TestServiceEvents<TContract>(IEventPublisherFactory eventPublisherFactory, Func<TContract, Task> scenario)
        where TContract : class
    Parameters
    Type Name Description
    IEventPublisherFactory eventPublisherFactory

    The event publisher factory.

    System.Func<TContract, System.Threading.Tasks.Task> scenario

    The scenario.

    Returns
    Type Description
    System.Threading.Tasks.Task
    Type Parameters
    Name Description
    TContract

    The contract type.

    Implements

    System.IDisposable
    • View Source
    Back to top Generated by DocFX