@@ -28,7 +28,7 @@ public void It_resolves_requestdelegategenerator_correctly(string testAssetName,
2828 } ) ;
2929
3030 VerifyRequestDelegateGeneratorIsUsed ( asset , isEnabled ) ;
31- VerifyInterceptorsFeatureEnabled ( asset , isEnabled ) ;
31+ VerifyInterceptorsFeatureEnabled ( asset , isEnabled , "Microsoft.AspNetCore.Http.Generated" ) ;
3232 }
3333
3434 [ Fact ]
@@ -45,7 +45,7 @@ public void It_enables_requestdelegategenerator_and_configbindinggenerator_for_P
4545
4646 VerifyRequestDelegateGeneratorIsUsed ( asset , expectEnabled : true ) ;
4747 VerifyConfigBindingGeneratorIsUsed ( asset , expectEnabled : true ) ;
48- VerifyInterceptorsFeatureEnabled ( asset , expectEnabled : true ) ;
48+ VerifyInterceptorsFeatureEnabled ( asset , expectEnabled : true , "Microsoft.AspNetCore.Http.Generated" , "Microsoft.Extensions.Configuration.Binder.SourceGeneration" ) ;
4949 }
5050
5151 [ Fact ]
@@ -62,7 +62,7 @@ public void It_enables_requestdelegategenerator_and_configbindinggenerator_for_P
6262
6363 VerifyRequestDelegateGeneratorIsUsed ( asset , expectEnabled : true ) ;
6464 VerifyConfigBindingGeneratorIsUsed ( asset , expectEnabled : true ) ;
65- VerifyInterceptorsFeatureEnabled ( asset , expectEnabled : true ) ;
65+ VerifyInterceptorsFeatureEnabled ( asset , expectEnabled : true , "Microsoft.AspNetCore.Http.Generated" , "Microsoft.Extensions.Configuration.Binder.SourceGeneration" ) ;
6666 }
6767
6868 private void VerifyGeneratorIsUsed ( TestAsset asset , bool ? expectEnabled , string generatorName )
@@ -90,23 +90,28 @@ private void VerifyRequestDelegateGeneratorIsUsed(TestAsset asset, bool? expectE
9090 private void VerifyConfigBindingGeneratorIsUsed ( TestAsset asset , bool ? expectEnabled )
9191 => VerifyGeneratorIsUsed ( asset , expectEnabled , "Microsoft.Extensions.Configuration.Binder.SourceGeneration.dll" ) ;
9292
93- private void VerifyInterceptorsFeatureEnabled ( TestAsset asset , bool ? expectEnabled )
93+ private void VerifyInterceptorsFeatureEnabled ( TestAsset asset , bool ? expectEnabled , params string [ ] expectedNamespaces )
9494 {
9595 var command = new GetValuesCommand (
9696 Log ,
9797 asset . Path ,
9898 ToolsetInfo . CurrentTargetFramework ,
99- "Features " ,
99+ "InterceptorsPreviewNamespaces " ,
100100 GetValuesCommand . ValueType . Property ) ;
101101
102102 command
103103 . WithWorkingDirectory ( asset . Path )
104104 . Execute ( )
105105 . Should ( ) . Pass ( ) ;
106106
107- var features = command . GetValues ( ) ;
107+ var namespaces = command . GetValues ( ) ;
108+ Console . WriteLine ( namespaces . Count ( ) ) ;
109+ foreach ( var @namespace in namespaces )
110+ {
111+ Console . WriteLine ( @namespace ) ;
112+ }
108113
109- Assert . Equal ( expectEnabled ?? false , features . Any ( feature => feature . Contains ( "InterceptorsPreview" ) ) ) ;
114+ Assert . Equal ( expectEnabled ?? false , expectedNamespaces . All ( expectedNamespace => namespaces . Contains ( expectedNamespace ) ) ) ;
110115 }
111116
112117 [ Theory ]
0 commit comments