-
Notifications
You must be signed in to change notification settings - Fork 1
How integrate support class with your class
NightAngell edited this page Feb 24, 2019
·
10 revisions
After you add nuget to your test project, SignalR_UnitTestingSupport is ready to use.
All IHubContext support classes are in
SignalR_UnitTestingSupportCommon.IHubContextSupport
namespace
For NUnit: All testing base classes are in
SignalR_UnitTestingSupport.Hubs
namespace
For xUnit: All testing base classes are in
SignalR_UnitTestingSupportXUnit.Hubs
namespace
For MSTest: All testing base classes are in
SignalR_UnitTestingSupportMSTest.Hubs
namespace
Create test class for hub for example:
class ExampleHubTests {}
And then:
class ExampleHubTests : HubUnitTestsBase {}
class ExampleHubTests : HubUnitTestsBase<T> {}
class ExampleHubTests : HubUnitTestsWithEF<TDbContext> {}
TDbContext is any class which inherit from
Microsoft.EntityFrameworkCore.DbContext
or DbContext itself.
class ExampleHubTests : HubUnitTestsWithEF<T, TDbContext> {}
TDbContext is any class which inherit from
Microsoft.EntityFrameworkCore.DbContext
or DbContext itself.
5. For testing with IHubContext<THub>
see this.
5. For testing with IHubContext<THub, TIHubResponses>
see this.
How use second approach. See this.