@@ -51,7 +51,7 @@ public async Task CanProcessAndResolveImageAsync()
5151 IImageFormat format = Configuration . Default . ImageFormatsManager . FindFormatByFileExtension ( ext ) ;
5252
5353 // First response
54- HttpResponseMessage response = await this . HttpClient . GetAsync ( url + this . AugmentCommand ( this . Fixture . Commands [ 0 ] ) ) ;
54+ HttpResponseMessage response = await this . HttpClient . GetAsync ( url + await this . AugmentCommandAsync ( this . Fixture . Commands [ 0 ] ) ) ;
5555
5656 Assert . NotNull ( response ) ;
5757 Assert . True ( response . IsSuccessStatusCode ) ;
@@ -67,7 +67,7 @@ public async Task CanProcessAndResolveImageAsync()
6767 response . Dispose ( ) ;
6868
6969 // Cached Response
70- response = await this . HttpClient . GetAsync ( url + this . AugmentCommand ( this . Fixture . Commands [ 0 ] ) ) ;
70+ response = await this . HttpClient . GetAsync ( url + await this . AugmentCommandAsync ( this . Fixture . Commands [ 0 ] ) ) ;
7171
7272 Assert . NotNull ( response ) ;
7373 Assert . True ( response . IsSuccessStatusCode ) ;
@@ -85,7 +85,7 @@ public async Task CanProcessAndResolveImageAsync()
8585 // 304 response
8686 var request = new HttpRequestMessage
8787 {
88- RequestUri = new Uri ( url + this . AugmentCommand ( this . Fixture . Commands [ 0 ] ) ) ,
88+ RequestUri = new Uri ( url + await this . AugmentCommandAsync ( this . Fixture . Commands [ 0 ] ) ) ,
8989 Method = HttpMethod . Get ,
9090 } ;
9191
@@ -108,7 +108,7 @@ public async Task CanProcessAndResolveImageAsync()
108108 // 412 response
109109 request = new HttpRequestMessage
110110 {
111- RequestUri = new Uri ( url + this . AugmentCommand ( this . Fixture . Commands [ 0 ] ) ) ,
111+ RequestUri = new Uri ( url + await this . AugmentCommandAsync ( this . Fixture . Commands [ 0 ] ) ) ,
112112 Method = HttpMethod . Get ,
113113 } ;
114114
@@ -127,8 +127,8 @@ public async Task CanProcessAndResolveImageAsync()
127127 public async Task CanProcessMultipleIdenticalQueriesAsync ( )
128128 {
129129 string url = this . ImageSource ;
130- string command1 = this . AugmentCommand ( this . Fixture . Commands [ 0 ] ) ;
131- string command2 = this . AugmentCommand ( this . Fixture . Commands [ 1 ] ) ;
130+ string command1 = await this . AugmentCommandAsync ( this . Fixture . Commands [ 0 ] ) ;
131+ string command2 = await this . AugmentCommandAsync ( this . Fixture . Commands [ 1 ] ) ;
132132
133133 Task [ ] tasks = Enumerable . Range ( 0 , 100 ) . Select ( i => Task . Run ( async ( ) =>
134134 {
@@ -144,6 +144,6 @@ public async Task CanProcessMultipleIdenticalQueriesAsync()
144144 Assert . True ( all . IsCompletedSuccessfully ) ;
145145 }
146146
147- protected virtual string AugmentCommand ( string command ) => command ;
147+ protected virtual Task < string > AugmentCommandAsync ( string command ) => Task . FromResult ( command ) ;
148148 }
149149}
0 commit comments