@@ -249,6 +249,32 @@ public static async Task Can_Intercept_Http_Requests_From_Bundle_File_With_Templ
249249 . ShouldBe ( @"[{""id"":123456,""name"":""httpclient-interception"",""full_name"":""justeat/httpclient-interception"",""private"":false,""owner"":{""login"":""justeat"",""id"":1516790}}]" ) ;
250250 }
251251
252+ [ Fact ]
253+ public static async Task Can_Intercept_Http_Requests_From_Bundle_File_With_Templated_Json_TemplateValues_Only_Defined_In_Code ( )
254+ {
255+ // Arrange
256+ var options = new HttpClientInterceptorOptions ( ) . ThrowsOnMissingRegistration ( ) ;
257+
258+ var templateValues = new Dictionary < string , string > ( )
259+ {
260+ [ "AvatarUrl" ] = "https://avatars.githubusercontent.com/u/1516790?v=4" ,
261+ [ "BlogUrl" ] = "https://tech.justeattakeaway.com/" ,
262+ [ "CompanyName" ] = "justeat" ,
263+ [ "RepoName" ] = "httpclient-interception" ,
264+ } ;
265+
266+ // Act
267+ options . RegisterBundle ( Path . Join ( "Bundles" , "templated-bundle-json-no-parameters.json" ) , templateValues ) ;
268+
269+ // Assert
270+ string content = await HttpAssert . GetAsync ( options , "https://api.github.com/orgs/justeat/repos" ) ;
271+ content
272+ . Replace ( " " , string . Empty , StringComparison . Ordinal )
273+ . Replace ( "\n " , string . Empty , StringComparison . Ordinal )
274+ . Replace ( "\r " , string . Empty , StringComparison . Ordinal )
275+ . ShouldBe ( @"[{""id"":123456,""name"":""httpclient-interception"",""full_name"":""justeat/httpclient-interception"",""private"":false,""owner"":{""login"":""justeat"",""id"":1516790}}]" ) ;
276+ }
277+
252278 [ Fact ]
253279 public static void RegisterBundle_Validates_Parameters ( )
254280 {
0 commit comments