File tree Expand file tree Collapse file tree 5 files changed +22
-55
lines changed
template_feed/Microsoft.DotNet.Common.ProjectTemplates.10.0/content
test/dotnet-new.IntegrationTests Expand file tree Collapse file tree 5 files changed +22
-55
lines changed Original file line number Diff line number Diff line change 1
1
<!-- #if (UseMSTestSdk)-->
2
- <Project Sdk =" MSTest.Sdk/3.10.0 " >
2
+ <Project Sdk =" MSTest.Sdk/4.0.0-preview.25415.9 " >
3
3
4
4
<PropertyGroup >
5
5
<TargetFramework Condition =" '$(TargetFrameworkOverride)' == ''" >net10.0</TargetFramework >
18
18
</ItemGroup >
19
19
<!-- #endif-->
20
20
<!-- #else-->
21
- <!--
22
- Displays error on console in addition to the log file. Note that this feature comes with a performance impact.
23
- For more information, visit https://learn.microsoft.com/dotnet/core/testing/unit-testing-platform-integration-dotnet-test#show-failure-per-test
24
- -->
25
- <TestingPlatformShowTestsFailure >true</TestingPlatformShowTestsFailure >
26
21
<TestingExtensionsProfile Condition =" '$(ExtensionsProfile)' != 'Default' " >$(ExtensionsProfile)</TestingExtensionsProfile >
27
22
</PropertyGroup >
28
23
<!-- #endif-->
41
36
<!-- #if (TestRunner == "Microsoft.Testing.Platform")-->
42
37
<EnableMSTestRunner >true</EnableMSTestRunner >
43
38
<OutputType >Exe</OutputType >
44
- <TestingPlatformDotnetTestSupport >true</TestingPlatformDotnetTestSupport >
45
- <!--
46
- Displays error on console in addition to the log file. Note that this feature comes with a performance impact.
47
- For more information, visit https://learn.microsoft.com/dotnet/core/testing/unit-testing-platform-integration-dotnet-test#show-failure-per-test
48
- -->
49
- <TestingPlatformShowTestsFailure >true</TestingPlatformShowTestsFailure >
50
39
<!-- #endif-->
51
40
</PropertyGroup >
52
41
53
42
<ItemGroup >
54
43
<!-- #if (CoverageTool == "coverlet")-->
55
44
<PackageReference Include =" coverlet.collector" Version =" 6.0.4" />
56
45
<!-- #endif-->
57
- <PackageReference Include =" MSTest" Version =" 3.10.0 " />
46
+ <PackageReference Include =" MSTest" Version =" 4.0.0-preview.25415.9 " />
58
47
</ItemGroup >
59
48
60
49
<ItemGroup >
Original file line number Diff line number Diff line change 1
1
<!-- #if (UseMSTestSdk)-->
2
- <Project Sdk =" MSTest.Sdk/3.10.0 " >
2
+ <Project Sdk =" MSTest.Sdk/4.0.0-preview.25415.9 " >
3
3
4
4
<PropertyGroup >
5
5
<TargetFramework Condition =" '$(TargetFrameworkOverride)' == ''" >net10.0</TargetFramework >
18
18
</ItemGroup >
19
19
<!-- #endif-->
20
20
<!-- #else-->
21
- <!--
22
- Displays error on console in addition to the log file. Note that this feature comes with a performance impact.
23
- For more information, visit https://learn.microsoft.com/dotnet/core/testing/unit-testing-platform-integration-dotnet-test#show-failure-per-test
24
- -->
25
- <TestingPlatformShowTestsFailure >true</TestingPlatformShowTestsFailure >
26
21
<TestingExtensionsProfile Condition =" '$(ExtensionsProfile)' != 'Default' " >$(ExtensionsProfile)</TestingExtensionsProfile >
27
22
</PropertyGroup >
28
23
<!-- #endif-->
46
41
<!-- #if (TestRunner == "Microsoft.Testing.Platform")-->
47
42
<EnableMSTestRunner >true</EnableMSTestRunner >
48
43
<OutputType >Exe</OutputType >
49
- <TestingPlatformDotnetTestSupport >true</TestingPlatformDotnetTestSupport >
50
- <!--
51
- Displays error on console in addition to the log file. Note that this feature comes with a performance impact.
52
- For more information, visit https://learn.microsoft.com/dotnet/core/testing/unit-testing-platform-integration-dotnet-test#show-failure-per-test
53
- -->
54
- <TestingPlatformShowTestsFailure >true</TestingPlatformShowTestsFailure >
55
44
<!-- #endif-->
56
45
</PropertyGroup >
57
46
58
47
<ItemGroup >
59
48
<!-- #if (CoverageTool == "coverlet")-->
60
49
<PackageReference Include =" coverlet.collector" Version =" 6.0.4" />
61
50
<!-- #endif-->
62
- <PackageReference Include =" MSTest" Version =" 3.10.0 " />
51
+ <PackageReference Include =" MSTest" Version =" 4.0.0-preview.25415.9 " />
63
52
</ItemGroup >
64
53
65
54
<ItemGroup >
Original file line number Diff line number Diff line change 1
1
<!-- #if (UseMSTestSdk)-->
2
- <Project Sdk =" MSTest.Sdk/3.10.0 " >
2
+ <Project Sdk =" MSTest.Sdk/4.0.0-preview.25415.9 " >
3
3
4
4
<PropertyGroup >
5
5
<TargetFramework Condition =" '$(TargetFrameworkOverride)' == ''" >net10.0</TargetFramework >
18
18
</ItemGroup >
19
19
<!-- #endif-->
20
20
<!-- #else-->
21
- <!--
22
- Displays error on console in addition to the log file. Note that this feature comes with a performance impact.
23
- For more information, visit https://learn.microsoft.com/dotnet/core/testing/unit-testing-platform-integration-dotnet-test#show-failure-per-test
24
- -->
25
- <TestingPlatformShowTestsFailure >true</TestingPlatformShowTestsFailure >
26
21
<TestingExtensionsProfile Condition =" '$(ExtensionsProfile)' != 'Default' " >$(ExtensionsProfile)</TestingExtensionsProfile >
27
22
</PropertyGroup >
28
23
<!-- #endif-->
41
36
<!-- #if (TestRunner == "Microsoft.Testing.Platform")-->
42
37
<EnableMSTestRunner >true</EnableMSTestRunner >
43
38
<OutputType >Exe</OutputType >
44
- <TestingPlatformDotnetTestSupport >true</TestingPlatformDotnetTestSupport >
45
- <!--
46
- Displays error on console in addition to the log file. Note that this feature comes with a performance impact.
47
- For more information, visit https://learn.microsoft.com/dotnet/core/testing/unit-testing-platform-integration-dotnet-test#show-failure-per-test
48
- -->
49
- <TestingPlatformShowTestsFailure >true</TestingPlatformShowTestsFailure >
50
39
<!-- #endif-->
51
40
</PropertyGroup >
52
41
53
42
<ItemGroup >
54
43
<!-- #if (CoverageTool == "coverlet")-->
55
44
<PackageReference Include =" coverlet.collector" Version =" 6.0.4" />
56
45
<!-- #endif-->
57
- <PackageReference Include =" MSTest" Version =" 3.10.0 " />
46
+ <PackageReference Include =" MSTest" Version =" 4.0.0-preview.25415.9 " />
58
47
</ItemGroup >
59
48
60
49
<ItemGroup >
Original file line number Diff line number Diff line change 1
1
<!-- #if (UseMSTestSdk)-->
2
- <Project Sdk =" MSTest.Sdk/3.10.0 " >
2
+ <Project Sdk =" MSTest.Sdk/4.0.0-preview.25415.9 " >
3
3
4
4
<PropertyGroup >
5
5
<TargetFramework Condition =" '$(TargetFrameworkOverride)' == ''" >net10.0</TargetFramework >
19
19
</ItemGroup >
20
20
<!-- #endif-->
21
21
<!-- #else-->
22
- <!--
23
- Displays error on console in addition to the log file. Note that this feature comes with a performance impact.
24
- For more information, visit https://learn.microsoft.com/dotnet/core/testing/unit-testing-platform-integration-dotnet-test#show-failure-per-test
25
- -->
26
- <TestingPlatformShowTestsFailure >true</TestingPlatformShowTestsFailure >
27
22
<TestingExtensionsProfile Condition =" '$(ExtensionsProfile)' != 'Default' " >$(ExtensionsProfile)</TestingExtensionsProfile >
28
23
</PropertyGroup >
29
24
<!-- #endif-->
42
37
<!-- #if (TestRunner == "Microsoft.Testing.Platform")-->
43
38
<EnableMSTestRunner >true</EnableMSTestRunner >
44
39
<OutputType >Exe</OutputType >
45
- <TestingPlatformDotnetTestSupport >true</TestingPlatformDotnetTestSupport >
46
- <!--
47
- Displays error on console in addition to the log file. Note that this feature comes with a performance impact.
48
- For more information, visit https://learn.microsoft.com/dotnet/core/testing/unit-testing-platform-integration-dotnet-test#show-failure-per-test
49
- -->
50
- <TestingPlatformShowTestsFailure >true</TestingPlatformShowTestsFailure >
51
40
<!-- #endif-->
52
41
</PropertyGroup >
53
42
54
43
<ItemGroup >
55
44
<!-- #if (CoverageTool == "coverlet")-->
56
45
<PackageReference Include =" coverlet.collector" Version =" 6.0.4" />
57
46
<!-- #endif-->
58
- <PackageReference Include =" Microsoft.Playwright.MSTest" Version =" 1.51.0 " />
59
- <PackageReference Include =" MSTest" Version =" 3.10.0 " />
47
+ <PackageReference Include =" Microsoft.Playwright.MSTest.v4 " Version =" 1.55.0-beta-4 " />
48
+ <PackageReference Include =" MSTest" Version =" 4.0.0-preview.25415.9 " />
60
49
</ItemGroup >
61
50
62
51
<ItemGroup >
Original file line number Diff line number Diff line change @@ -193,14 +193,25 @@ public void MSTestAndPlaywrightProjectTemplate_WithCoverageToolAndTestRunner_Can
193
193
194
194
if ( runDotnetTest )
195
195
{
196
+ var isMTP = testRunner == "Microsoft.Testing.Platform" ;
197
+ if ( isMTP )
198
+ {
199
+ File . WriteAllText ( Path . Combine ( outputDirectory , "dotnet.config" ) , """
200
+ [dotnet.test.runner]
201
+ name = "Microsoft.Testing.Platform"
202
+ """ ) ;
203
+ }
204
+
196
205
var result = new DotnetTestCommand ( _log , false )
197
206
. WithWorkingDirectory ( outputDirectory )
198
- . Execute ( outputDirectory ) ;
207
+ #pragma warning disable SA1010 // Opening square brackets should be spaced correctly - false positive. Current formatting is good.
208
+ . Execute ( isMTP ? [ "--directory" , outputDirectory ] : [ outputDirectory ] ) ;
209
+ #pragma warning restore SA1010 // Opening square brackets should be spaced correctly
199
210
200
211
result . Should ( ) . Pass ( ) ;
201
212
202
213
result . StdOut . Should ( ) . Contain ( "Passed!" ) ;
203
- result . StdOut . Should ( ) . MatchRegex ( @"Passed:\s*1" ) ;
214
+ result . StdOut . Should ( ) . MatchRegex ( isMTP ? "succeeded: 1" : @"Passed:\s*1" ) ;
204
215
}
205
216
206
217
// After executing dotnet new and before cleaning up
You can’t perform that action at this time.
0 commit comments