@@ -73,6 +73,21 @@ public void It_enables_requestdelegategenerator_and_configbindinggenerator_for_P
73
73
VerifyInterceptorsFeatureProperties ( asset , expectEnabled : true , "Microsoft.AspNetCore.Http.Generated" , "Microsoft.Extensions.Configuration.Binder.SourceGeneration" ) ;
74
74
}
75
75
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
+
76
91
[ Fact ]
77
92
public void It_enables_requestdelegategenerator_and_configbindinggenerator_for_PublishTrimmed ( )
78
93
{
@@ -115,6 +130,9 @@ private void VerifyRequestDelegateGeneratorIsUsed(TestAsset asset, bool? expectE
115
130
private void VerifyConfigBindingGeneratorIsUsed ( TestAsset asset , bool ? expectEnabled )
116
131
=> VerifyGeneratorIsUsed ( asset , expectEnabled , "Microsoft.Extensions.Configuration.Binder.SourceGeneration.dll" ) ;
117
132
133
+ private void VerifyValidationsGeneratorIsUsed ( TestAsset asset , bool ? expectEnabled )
134
+ => VerifyGeneratorIsUsed ( asset , expectEnabled , "Microsoft.AspNetCore.Http.ValidationsGenerator.dll" ) ;
135
+
118
136
private void VerifyInterceptorsFeatureProperties ( TestAsset asset , bool ? expectEnabled , params string [ ] expectedNamespaces )
119
137
{
120
138
var command = new GetValuesCommand (
0 commit comments