@@ -40,7 +40,6 @@ public void Start_Stop_IsRunning()
4040 Assert . False ( _metricServer . IsRunning ) ;
4141 }
4242
43-
4443 [ Fact ]
4544 public void Start_DoubleStop_IsRunning ( )
4645 {
@@ -73,7 +72,6 @@ public void Start_Stop_WithDefaultPort_IsRunning()
7372 Assert . False ( _metricServer . IsRunning ) ;
7473 }
7574
76-
7775 [ Fact ]
7876 public void Start_Stop_WithDefaultRegisry_IsRunning ( )
7977 {
@@ -93,7 +91,7 @@ public async Task BaseMapPath_FindMetrics()
9391 var counter = Metrics . DefaultFactory . CreateCounter ( "test_counter" , "help" ) ;
9492 counter . Inc ( ) ;
9593 using var httpClient = new HttpClient ( ) ;
96- string response = await httpClient . GetStringAsync ( $ "http://localhost:{ _port } /metrics ") ;
94+ string response = await httpClient . GetStringAsync ( $ "http://localhost:{ _port } { Defaults . MapPath } ") ;
9795 Assert . False ( string . IsNullOrEmpty ( response ) ) ;
9896 Assert . Contains ( "process_private_memory_bytes" , response ) ;
9997 Assert . Contains ( "dotnet_total_memory_bytes" , response ) ;
@@ -136,8 +134,8 @@ public async Task SetMapPath_FindMetricsWithEndSlash()
136134 }
137135
138136 [ Theory ]
137+ [ InlineData ( Defaults . MapPath ) ]
139138 [ InlineData ( "metrics" ) ]
140- [ InlineData ( "/metrics" ) ]
141139 [ InlineData ( "metrics12" ) ]
142140 [ InlineData ( "/metrics965" ) ]
143141 public async Task SetMapPath_FindMetrics ( string mapPath )
@@ -181,7 +179,7 @@ public async Task CustomCounter_FindMetric()
181179 counter . Inc ( ) ;
182180
183181 using var httpClient = new HttpClient ( ) ;
184- string response = await httpClient . GetStringAsync ( $ "http://localhost:{ _port } /metrics ") ;
182+ string response = await httpClient . GetStringAsync ( $ "http://localhost:{ _port } { Defaults . MapPath } ") ;
185183 Assert . Contains ( metricName , response ) ;
186184 }
187185 catch ( Exception ex )
@@ -202,7 +200,7 @@ public async Task AddLegacyMetrics_False_FindMetrics()
202200 {
203201 _metricServer . Start ( ) ;
204202 using var httpClient = new HttpClient ( ) ;
205- string response = await httpClient . GetStringAsync ( $ "http://localhost:{ _port } /metrics ") ;
203+ string response = await httpClient . GetStringAsync ( $ "http://localhost:{ _port } { Defaults . MapPath } ") ;
206204 Assert . Contains ( "process_private_memory_bytes" , response ) ;
207205 Assert . Contains ( "dotnet_total_memory_bytes" , response ) ;
208206 Assert . DoesNotContain ( "process_private_bytes" , response ) ;
@@ -228,7 +226,7 @@ public async Task AddLegacyMetrics_True_FindMetrics()
228226 {
229227 _metricServer . Start ( ) ;
230228 using var httpClient = new HttpClient ( ) ;
231- string response = await httpClient . GetStringAsync ( $ "http://localhost:{ _port } /metrics ") ;
229+ string response = await httpClient . GetStringAsync ( $ "http://localhost:{ _port } { Defaults . MapPath } ") ;
232230 Assert . Contains ( "process_private_memory_bytes" , response ) ;
233231 Assert . Contains ( "dotnet_total_memory_bytes" , response ) ;
234232 Assert . Contains ( "process_private_bytes" , response ) ;
@@ -285,7 +283,7 @@ public async Task CustormEncoding_FindHelp()
285283 counter . Inc ( ) ;
286284
287285 using var httpClient = new HttpClient ( ) ;
288- string response = await httpClient . GetStringAsync ( $ "http://localhost:{ _port } /metrics ") ;
286+ string response = await httpClient . GetStringAsync ( $ "http://localhost:{ _port } { Defaults . MapPath } ") ;
289287 Assert . Contains ( help , response ) ;
290288 }
291289 catch ( Exception ex )
0 commit comments