Skip to content

Instantly share code, notes, and snippets.

@litichevskiydv
Created May 28, 2017 10:01
Show Gist options
  • Save litichevskiydv/706c00f9f31e894f85578a65ca8f838f to your computer and use it in GitHub Desktop.
Save litichevskiydv/706c00f9f31e894f85578a65ca8f838f to your computer and use it in GitHub Desktop.
Base class for tests
public class BaseServiceClientTests<TFixture, TServiceClient>
where TFixture : BaseApiTestsFixture, new()
where TServiceClient : BaseClient
{
protected readonly TFixture Fixture;
protected readonly TServiceClient ServiceClient;
protected BaseServiceClientTests(TFixture fixture)
{
Fixture = fixture;
Fixture.MockLogger.ResetCalls();
ServiceClient = (TServiceClient) Activator.CreateInstance(typeof(TServiceClient),
Fixture.Server.CreateHandler(),
new ClientConfiguration
{
BaseUrl = Fixture.Server.BaseAddress.ToString(),
TimeoutInMilliseconds = Fixture.TimeoutInMilliseconds
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment