File tree Expand file tree Collapse file tree 1 file changed +52
-0
lines changed
test/Microsoft.NET.Build.Tests Expand file tree Collapse file tree 1 file changed +52
-0
lines changed Original file line number Diff line number Diff line change @@ -498,6 +498,58 @@ public void ItWarnsWhenBuildingAProjectTargetingCsWinRT3_0()
498498 . NotHaveStdOutContaining ( "NETSDK1229" ) ;
499499 }
500500
501+ [ WindowsOnlyFact ]
502+ public void ItImplicitlyDefinesCSWINRT3_0WhenBuildingAProjectTargetingCsWinRT3_0 ( )
503+ {
504+ TestProject testProject = new ( )
505+ {
506+ Name = "A" ,
507+ ProjectSdk = "Microsoft.NET.Sdk" ,
508+ TargetFrameworks = "net10.0-windows10.0.22621.1" ,
509+ SourceFiles =
510+ {
511+ [ "Program.cs" ] = """
512+ #if !CSWINRT3_0
513+ #error CSWINRT3_0 is not defined
514+ #endif
515+ """
516+ }
517+ } ;
518+
519+ var testAsset = _testAssetsManager . CreateTestProject ( testProject ) ;
520+
521+ var buildCommand = new BuildCommand ( testAsset ) ;
522+ buildCommand . Execute ( )
523+ . Should ( )
524+ . Pass ( ) ;
525+ }
526+
527+ [ WindowsOnlyFact ]
528+ public void ItDoesNotImplicitlyDefineCSWINRT3_0WhenBuildingAProjectNotTargetingCsWinRT3_0 ( )
529+ {
530+ TestProject testProject = new ( )
531+ {
532+ Name = "A" ,
533+ ProjectSdk = "Microsoft.NET.Sdk" ,
534+ TargetFrameworks = "net10.0-windows10.0.22621.0" ,
535+ SourceFiles =
536+ {
537+ [ "Program.cs" ] = """
538+ #if CSWINRT3_0
539+ #error CSWINRT3_0 is defined
540+ #endif
541+ """
542+ }
543+ } ;
544+
545+ var testAsset = _testAssetsManager . CreateTestProject ( testProject ) ;
546+
547+ var buildCommand = new BuildCommand ( testAsset ) ;
548+ buildCommand . Execute ( )
549+ . Should ( )
550+ . Pass ( ) ;
551+ }
552+
501553 [ WindowsOnlyFact ]
502554 public void ItErrorsWhenTargetingBelowNet6WithUseUwpProperty ( )
503555 {
You can’t perform that action at this time.
0 commit comments