11using System . Globalization ;
22using System . Net ;
3+ using System . Net . Http . Json ;
4+ using Api . Setup ;
35using Shouldly ;
46using Xunit ;
57
@@ -24,6 +26,12 @@ public async Task LongestDownwardTrend(string? fromDate, string? toDate, HttpSta
2426 {
2527 var result = await _fixture . Client . GetAsync ( $ "{ BaseUrl } /longestdownwardtrend?fromDate={ fromDate } &toDate={ toDate } ") ;
2628 result . StatusCode . ShouldBeOneOf ( status , HttpStatusCode . TooManyRequests ) ;
29+
30+ if ( result . StatusCode == HttpStatusCode . OK )
31+ {
32+ var data = await result . Content . ReadFromJsonAsync < LongestDownwardTrendResponse > ( ) ;
33+ data . ShouldNotBeNull ( ) ;
34+ }
2735 }
2836
2937 [ Theory ]
@@ -32,6 +40,12 @@ public async Task HighestTradingVolume(string? fromDate, string? toDate, HttpSta
3240 {
3341 var result = await _fixture . Client . GetAsync ( $ "{ BaseUrl } /highestradingvolume?fromDate={ fromDate } &toDate={ toDate } ") ;
3442 result . StatusCode . ShouldBeOneOf ( status , HttpStatusCode . TooManyRequests ) ;
43+
44+ if ( result . StatusCode == HttpStatusCode . OK )
45+ {
46+ var data = await result . Content . ReadFromJsonAsync < HighestTradingVolumeResponse > ( ) ;
47+ data . ShouldNotBeNull ( ) ;
48+ }
3549 }
3650
3751 [ Theory ]
@@ -40,6 +54,12 @@ public async Task BuyAndSell(string? fromDate, string? toDate, HttpStatusCode st
4054 {
4155 var result = await _fixture . Client . GetAsync ( $ "{ BaseUrl } /buyandsell?fromDate={ fromDate } &toDate={ toDate } ") ;
4256 result . StatusCode . ShouldBeOneOf ( status , HttpStatusCode . TooManyRequests ) ;
57+
58+ if ( result . StatusCode == HttpStatusCode . OK )
59+ {
60+ var data = await result . Content . ReadFromJsonAsync < BuyAndSellResponse > ( ) ;
61+ data . ShouldNotBeNull ( ) ;
62+ }
4363 }
4464
4565 [ Fact ]
0 commit comments