Skip to content

How integrate support class with your class

NightAngell edited this page Feb 15, 2019 · 10 revisions

After you add nuget to your test project, SignalR_UnitTestingSupport is ready to use.

All testing base classes are in SignalR_UnitTestingSupport.Hubs namespace Create test class for hub for example:

class ExampleHubTests {}

And then:

1. For testing Hub

class ExampleHubTests : HubUnitTestsBase {}

2. For testing Hub<T>

class ExampleHubTests : HubUnitTestsBase<T> {}

3. For testing Hub with EntityFrameworkCore

class ExampleHubTests : HubUnitTestsWithEF<TDbContext> {}

TDbContext is any class which inherit from Microsoft.EntityFrameworkCore.DbContext od DbContext itself.

4. For testing Hub<T> with EntityFrameworkCore

class ExampleHubTests : HubUnitTestsWithEF<T, TDbContext> {}

TDbContext is any class which inherit from Microsoft.EntityFrameworkCore.DbContext od DbContext itself.

Important

HubUnitTestsBaseCommon is internal class (it must be marked by code as public, because it contain common code for all base classes). Do not use it by itself.

Clone this wiki locally