File tree Expand file tree Collapse file tree 5 files changed +8
-10
lines changed Expand file tree Collapse file tree 5 files changed +8
-10
lines changed Original file line number Diff line number Diff line change 33using System . Globalization ;
44using System . IO ;
55using System . Net ;
6+ using System . Net . Http ;
67using System . Text ;
78using System . Threading . Tasks ;
89using X . Web . RSS . Enumerators ;
@@ -62,11 +63,8 @@ public async Task Test()
6263 {
6364 var serializer = new RssDocumentSerializer ( ) ;
6465
65- var request = WebRequest . Create ( "https://feeds.bbci.co.uk/news/world/rss.xml" ) ;
66- var response = await request . GetResponseAsync ( ) ;
67- var stream = response . GetResponseStream ( ) ;
68- var streamReader = new StreamReader ( stream ) ;
69- var xml = await streamReader . ReadToEndAsync ( ) ;
66+ using var http = new HttpClient ( ) ;
67+ var xml = await http . GetStringAsync ( "https://feeds.bbci.co.uk/news/world/rss.xml" ) ;
7068
7169 var rss = serializer . Deserialize ( xml ) ;
7270
Original file line number Diff line number Diff line change @@ -184,7 +184,7 @@ public void SetString_Null_DateNull()
184184 rssDate . DateString = null ;
185185
186186 // Assert
187- Assert . Equal ( null , rssDate . Date ) ;
187+ Assert . Null ( rssDate . Date ) ;
188188 }
189189
190190 [ Fact ]
Original file line number Diff line number Diff line change @@ -136,6 +136,6 @@ public void SetTtl_Zero_StringNull()
136136 rssTtl . TTL = 0 ;
137137
138138 // Assert
139- Assert . Equal ( null , rssTtl . TTL ) ;
139+ Assert . Null ( rssTtl . TTL ) ;
140140 }
141141}
Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ public void SetString_Null_UriNull()
9898 rssUrl . Url = null ;
9999
100100 // Assert
101- Assert . Equal ( null , rssUrl . Url ) ;
101+ Assert . Null ( rssUrl . Url ) ;
102102 }
103103
104104 [ Fact ]
@@ -111,7 +111,7 @@ public void SetUri_Null_StringNull()
111111 rssUrl . Url = null ;
112112
113113 // Assert
114- Assert . Equal ( null , rssUrl . Url ) ;
114+ Assert . Null ( rssUrl . Url ) ;
115115 }
116116
117117 [ Fact ]
Original file line number Diff line number Diff line change 11<Project Sdk =" Microsoft.NET.Sdk" >
22
33 <PropertyGroup >
4- <TargetFramework >net8.0</TargetFramework >
54 <IsPackable >false</IsPackable >
65 <LangVersion >default</LangVersion >
6+ <TargetFramework >net8.0</TargetFramework >
77 </PropertyGroup >
88
99 <ItemGroup >
You can’t perform that action at this time.
0 commit comments