You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<!-- Remove legacy AutoFixture.Xunit2 using if brought transitively -->
26
+
<ItemGroup>
27
+
<UsingRemove="AutoFixture.Xunit2" />
28
+
</ItemGroup>
29
+
</Project>
30
+
```
6
31
7
-
> **Version Notes:**
8
-
> If you are using the `MemberAutoNSubstituteData` attribute, ensure that both `xunit` and `xunit.extensibility.core` packages are set to version **2.9.0**.
9
-
> This is because the latest versions of xUnit are currently incompatible with `MemberAutoNSubstituteData` due to an unresolved issue. Although [xunit/xunit#3031](https://github.com/xunit/xunit/issues/3031) has been closed, the problem remains unresolved.
10
-
> Upgrading beyond version 2.9.0 may result in test failures or unexpected behavior.
32
+
`Atc.Test` depends on `xunit.v3.extensibility.core` for the extensibility APIs, but it intentionally does NOT bring in the `xunit.v3` meta-package for you.
33
+
34
+
### Why you must still reference xUnit directly
35
+
36
+
We do not make `xunit.v3` transitive because:
37
+
38
+
- The `xunit.v3` meta-package pulls in runner-related assets that are not targeted for `netstandard2.1`; this causes NU1701 framework fallback warnings if we referenced it from the multi-targeted library.
39
+
- Consumers should control the exact xUnit version (pin or float) in their test project without the library forcing an upgrade cadence.
40
+
- Keeping test framework + runner packages at the application (test project) layer avoids unexpected breaking changes when updating `Atc.Test`.
41
+
- Separation of concerns: `Atc.Test` provides data attributes/utilities; the test project owns the choice of framework + runner configuration.
42
+
43
+
If you need a different xUnit patch/minor version, just adjust the `<PackageReference Include="xunit.v3" ... />` in your test project.
11
44
12
45
13
46
## Test Attributes
@@ -18,8 +51,45 @@ Common tools for writing tests using XUnit, AutoFixture, NSubstitute and FluentA
18
51
|`InlineAutoNSubstituteData`| Provides a data source for a data theory, with the data coming from inline values combined with auto-generated data specimens generated by AutoFixture and NSubstitute.|
19
52
|`MemberAutoNSubstituteData`| Provides a data source for a data theory, with the data coming from one of the following sources and combined with auto-generated data specimens generated by AutoFixture and NSubstitute.|
All remaining parameters (after those satisfied by inline/member data) are populated using an AutoFixture `IFixture` customized with NSubstitute for interfaces/abstract classes.
90
+
21
91
> **Note:**
22
-
> NSubstitute is used when the type being created is abstract, or when the `[Substitute]` is applied.
92
+
> NSubstitute is used when the type being created is an interface or abstract class.
23
93
24
94
## Test Helpers
25
95
@@ -33,7 +103,7 @@ Common tools for writing tests using XUnit, AutoFixture, NSubstitute and FluentA
33
103
34
104
## Extensibility
35
105
36
-
The default `Fixture` returned by the `FixtrueFactory.Create()` method is used for all the `Attributes` mentioned above.
106
+
The default `Fixture` returned by the `FixtureFactory.Create()` method is used for all the attributes mentioned above.
37
107
38
108
To add customizations to this, you can add the `AutoRegisterAttribute` to any custom `ICustomization` or `ISpecimenBuilder` to have it automatically added to the Fixture.
0 commit comments