Skip to content

Commit 9d0e909

Browse files
authored
Update docs for class-data-source with updated SharedType enums (#1792)
1 parent 0904828 commit 9d0e909

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

docs/docs/tutorial-basics/class-data-source.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,15 @@ Options are:
1818
### Shared = SharedType.None
1919
The instance is not shared ever. A new one will be created for you.
2020

21-
### Shared = SharedType.Globally
22-
The instance is shared globally for every test that also uses this setting, meaning it'll always be the same instance.
23-
24-
### Shared = SharedType.ForClass
21+
### Shared = SharedType.PerClass
2522
The instance is shared for every test in the same class as itself, that also has this setting.
2623

24+
### Shared = SharedType.PerAssembly
25+
The instance is shared for every test in the same assembly as itself, that also has this setting.
26+
27+
### Shared = SharedType.PerTestSession
28+
The instance is shared for every test in the current test session, meaning it'll always be the same instance.
29+
2730
### Shared = SharedType.Keyed
2831
When using this, you must also populate the `Key` argument on the attribute.
2932

@@ -38,7 +41,7 @@ If you need to do some initialization or teardown for when this object is create
3841
public class MyTestClass
3942
{
4043
[Test]
41-
[ClassDataSource<WebApplicationFactory>(Shared = SharedType.Globally)]
44+
[ClassDataSource<WebApplicationFactory>(Shared = SharedType.PerTestSession)]
4245
public void MyTest(WebApplicationFactory webApplicationFactory)
4346
{
4447
}
@@ -70,11 +73,11 @@ E.g.
7073
[Test]
7174
[ClassDataSource<Value1, Value2, Value3, Value4, Value5>
7275
(
73-
Shared = [SharedType.Globally, SharedType.Keyed, SharedType.ForClass, SharedType.Keyed, SharedType.None],
76+
Shared = [SharedType.PerTestSession, SharedType.Keyed, SharedType.PerClass, SharedType.Keyed, SharedType.None],
7477
Keys = [ "Value2Key", "Value4Key" ]
7578
)]
7679
public class MyType(Value1 value1, Value2 value2, Value3 value3, Value4 value4, Value5 value5)
7780
{
7881

7982
}
80-
```
83+
```

0 commit comments

Comments
 (0)