@@ -73,6 +73,21 @@ public void It_enables_requestdelegategenerator_and_configbindinggenerator_for_P
7373 VerifyInterceptorsFeatureProperties ( asset , expectEnabled : true , "Microsoft.AspNetCore.Http.Generated" , "Microsoft.Extensions.Configuration.Binder.SourceGeneration" ) ;
7474 }
7575
76+ [ Theory ]
77+ [ InlineData ( "net10.0" , true ) ]
78+ [ InlineData ( "net9.0" , false ) ]
79+ [ InlineData ( "net8.0" , false ) ]
80+ public void It_enables_validationsgenerator_correctly_for_TargetFramework ( string targetFramework , bool expectEnabled )
81+ {
82+ var asset = _testAssetsManager
83+ . CopyTestAsset ( "WebApp" )
84+ . WithSource ( )
85+ . WithTargetFramework ( targetFramework ) ;
86+
87+ VerifyValidationsGeneratorIsUsed ( asset , expectEnabled ) ;
88+ VerifyInterceptorsFeatureProperties ( asset , expectEnabled , "Microsoft.AspNetCore.Http.Validation.Generated" ) ;
89+ }
90+
7691 [ Fact ]
7792 public void It_enables_requestdelegategenerator_and_configbindinggenerator_for_PublishTrimmed ( )
7893 {
@@ -115,6 +130,9 @@ private void VerifyRequestDelegateGeneratorIsUsed(TestAsset asset, bool? expectE
115130 private void VerifyConfigBindingGeneratorIsUsed ( TestAsset asset , bool ? expectEnabled )
116131 => VerifyGeneratorIsUsed ( asset , expectEnabled , "Microsoft.Extensions.Configuration.Binder.SourceGeneration.dll" ) ;
117132
133+ private void VerifyValidationsGeneratorIsUsed ( TestAsset asset , bool ? expectEnabled )
134+ => VerifyGeneratorIsUsed ( asset , expectEnabled , "Microsoft.AspNetCore.Http.ValidationsGenerator.dll" ) ;
135+
118136 private void VerifyInterceptorsFeatureProperties ( TestAsset asset , bool ? expectEnabled , params string [ ] expectedNamespaces )
119137 {
120138 var command = new GetValuesCommand (
0 commit comments