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
Copy file name to clipboardExpand all lines: docs/core/testing/unit-testing-mstest-sdk.md
+16-30Lines changed: 16 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,41 +8,37 @@ ms.date: 02/13/2024
8
8
9
9
# MSTest SDK overview
10
10
11
-
[MSTest.Sdk](https://www.nuget.org/packages/MSTest.Sdk) is a[MSBuild project SDK](/visualstudio/msbuild/how-to-use-project-sdk) for building MSTest apps. It's possible to build a MSTest app without this SDK, however, the MSTest SDK is:
11
+
[MSTest.Sdk](https://www.nuget.org/packages/MSTest.Sdk) is an[MSBuild project SDK](/visualstudio/msbuild/how-to-use-project-sdk) for building MSTest apps. It's possible to build a MSTest app without this SDK, however, the MSTest SDK is:
12
12
13
13
* Tailored towards providing a first-class experience for testing with MSTest.
14
14
* The recommended target for most users.
15
15
* Easy to configure for other users.
16
16
17
-
The MSTest SDK discovers and runs your tests using the [MSTest runner](./unit-testing-mstest-runner-intro.md).
17
+
By default, the MSTest SDK discovers and runs your tests using the [MSTest runner for Microsoft.Testing.Platform](./unit-testing-mstest-runner-intro.md). You can switch to using VSTest by specifying `<UseVSTest>true</UseVSTest>`
18
18
19
19
You can enable `MSTest.Sdk` in a project by simply updating the `Sdk` attribute of the `Project` node of your project:
20
20
21
21
```xml
22
-
<ProjectSdk="MSTest.Sdk/3.6.3">
22
+
<ProjectSdk="MSTest.Sdk/3.8.3">
23
23
24
-
<PropertyGroup>
25
-
<TargetFramework>net8.0</TargetFramework>
26
-
</PropertyGroup>
27
-
28
-
<!-- references to the code to test -->
24
+
<PropertyGroup>
25
+
<TargetFramework>net8.0</TargetFramework>
26
+
</PropertyGroup>
29
27
30
28
</Project>
31
29
```
32
30
33
31
> [!NOTE]
34
-
> `/3.6.3` is given as example and can be replaced with any newer version.
32
+
> `/3.8.3` is given as example and can be replaced with any newer version.
35
33
36
34
To simplify handling of versions, we recommend setting the SDK version at solution level using the _global.json_ file. For example, your project file would look like:
37
35
38
36
```xml
39
37
<ProjectSdk="MSTest.Sdk">
40
38
41
-
<PropertyGroup>
42
-
<TargetFramework>net8.0</TargetFramework>
43
-
</PropertyGroup>
44
-
45
-
<!-- references to the code to test -->
39
+
<PropertyGroup>
40
+
<TargetFramework>net8.0</TargetFramework>
41
+
</PropertyGroup>
46
42
47
43
</Project>
48
44
```
@@ -52,7 +48,7 @@ Then, specify the `MSTest.Sdk` version in the _global.json_ file as follows:
52
48
```json
53
49
{
54
50
"msbuild-sdks": {
55
-
"MSTest.Sdk": "3.6.3"
51
+
"MSTest.Sdk": "3.8.3"
56
52
}
57
53
}
58
54
```
@@ -115,15 +111,13 @@ You can set the profile using the property `TestingExtensionsProfile` with one o
@@ -144,15 +138,13 @@ Extensions can be enabled and disabled by MSBuild properties with the pattern `E
144
138
For example, to enable the crash dump extension (NuGet package [Microsoft.Testing.Extensions.CrashDump](https://www.nuget.org/packages/Microsoft.Testing.Extensions.CrashDump)), you can use the following property `EnableMicrosoftTestingExtensionsCrashDump` set to `true`:
@@ -168,15 +160,13 @@ This property pattern can be used to enable an additional extension on top of th
168
160
You can also disable an extension that's coming from the selected profile. For example, disable the `MS Code Coverage` extension by setting `<EnableMicrosoftTestingExtensionsCodeCoverage>false</EnableMicrosoftTestingExtensionsCodeCoverage>`:
0 commit comments