Skip to content

Commit 685e335

Browse files
authored
Update README.md
Updated how to use
1 parent 7ad7153 commit 685e335

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

README.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,16 @@ https://www.nuget.org/packages/Microsoft.NET.Test.Sdk/
3838

3939
# How to use
4040
After you add nuget to your test project, SignalR_UnitTestingSupport is ready to use.
41+
> All IHubContext support classes are in ```SignalR_UnitTestingSupportCommon.IHubContextSupport``` namespace
42+
43+
> For NUnit: All testing base classes are in ```SignalR_UnitTestingSupport.Hubs``` namespace
44+
45+
> For xUnit: All testing base classes are in ```SignalR_UnitTestingSupportXUnit.Hubs``` namespace
46+
47+
> For MSTest: All testing base classes are in ```SignalR_UnitTestingSupportMSTest.Hubs``` namespace
48+
49+
## 1) Base classes approach (Recommended)
50+
4151
Create test class for hub for example:
4252
```csharp
4353
class ExampleHubTests {}
@@ -61,8 +71,9 @@ class ExampleHubTests : HubUnitTestsWithEF<TDbContext> {}
6171
class ExampleHubTests : HubUnitTestsWithEF<T, TDbContext> {}
6272
```
6373
> TDbContext is any class which inherit from ```Microsoft.EntityFrameworkCore.DbContext``` or DbContext itself.
74+
#### 5. For testing with ```IHubContext<THub>``` see [this](https://github.com/NightAngell/SignalR_UnitTestingSupport/wiki/Associated-with-IHubContext-for-Hub).
75+
#### 5. For testing with ```IHubContext<THub, TIHubResponses>``` see [this](https://github.com/NightAngell/SignalR_UnitTestingSupport/wiki/Associated-with-IHubContext-for-HubT).
6476
65-
### Important
66-
```HubUnitTestsBaseCommon``` is internal class (it must be marked by code as public). Do not use it.
67-
77+
## 2) Testing objects approach (Alternative, if you can't use base classes).
78+
How use second approach. See [this](https://github.com/NightAngell/SignalR_UnitTestingSupport/wiki/How-use-testing-support-if-you-don't-want-(or-you-can%60t)-use-provided-by-me-base-classes-or-your-testing-framework-don't-support-before-and-after-each-test-code-execution-features).
6879
## For full docs see: [Docs](https://github.com/NightAngell/SignalR_UnitTestingSupport/wiki)

0 commit comments

Comments
 (0)