Skip to content

Commit fd553a3

Browse files
Misc refactoring & tweaks
1 parent b44ea73 commit fd553a3

File tree

8 files changed

+13
-16
lines changed

8 files changed

+13
-16
lines changed

NScrape.Test/HtmlFormDefinitionTests.cs renamed to NScrape.Test/Forms/HtmlFormDefinitionTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
using System.Linq;
2-
using Xunit;
32
using NScrape.Forms;
3+
using Xunit;
44

5-
namespace NScrape.Test {
5+
namespace NScrape.Test.Forms {
66
public class HtmlFormDefinitionTests {
77
[Fact]
88
public void TestSingleFormTextsAndDropdown() {

NScrape.Test/HtmlFormTests.cs renamed to NScrape.Test/Forms/HtmlFormTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Linq;
4-
using Xunit;
54
using NScrape.Forms;
5+
using Xunit;
66

7-
namespace NScrape.Test {
7+
namespace NScrape.Test.Forms {
88
public class HtmlFormTests {
99
private class TestScraper : Scraper {
1010
public TestScraper( string html ) : base( html ) {

NScrape.Test/NScrape.Test.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@
6565
<Compile Include="NScrapeExtensionTests.cs" />
6666
<Compile Include="WebResponseTests.cs" />
6767
<Compile Include="NScrapeUtilityTryParseHttpDateTests.cs" />
68-
<Compile Include="HtmlFormTests.cs" />
69-
<Compile Include="HtmlFormDefinitionTests.cs" />
68+
<Compile Include="Forms\HtmlFormTests.cs" />
69+
<Compile Include="Forms\HtmlFormDefinitionTests.cs" />
7070
<Compile Include="Properties\AssemblyInfo.cs" />
7171
<Compile Include="Properties\Resources.Designer.cs">
7272
<AutoGen>True</AutoGen>

NScrape.Test/WebResponseTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ public void ImageWebResponseTest() {
219219
public void BinaryWebResponseTest() {
220220
var webClient = new WebClient();
221221

222-
var uri = new Uri( "https://download-cdn.getsync.com/stable/windows64/BitTorrent-Sync_x64.exe" );
222+
var uri = new Uri( "https://download-cdn.getsync.com/stable/windows64/Resilio-Sync_x64.exe" );
223223

224224
using ( var response = webClient.SendRequest( uri ) ) {
225225
Assert.NotNull( response );
@@ -249,7 +249,7 @@ public void BinaryWebResponseTest() {
249249
public void BinaryWebResponseDataPropertyBackwardsCompatibilityTest() {
250250
var webClient = new WebClient();
251251

252-
var uri = new Uri( "https://download-cdn.getsync.com/stable/windows64/BitTorrent-Sync_x64.exe" );
252+
var uri = new Uri( "https://download-cdn.getsync.com/stable/windows64/Resilio-Sync_x64.exe" );
253253

254254
using ( var response = webClient.SendRequest( uri ) ) {
255255
Assert.NotNull( response );

NScrape/Cookies/SetCookieHeaderGrammar.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ namespace NScrape.Cookies {
44
// Building an External DSL in C#
55
// http://nblumhardt.com/2010/01/building-an-external-dsl-in-c/
66
//
7-
// sprache/Sprache
7+
// Sprache
88
// https://github.com/sprache/Sprache
99
internal static class SetCookieHeaderGrammar {
1010
public static readonly Parser<char> EqualsSeparator = Parse.Char( '=' );

NScrape/NScrapeUtility.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Globalization;
4-
using System.Linq;
54
using System.Net;
65
using NScrape.Cookies;
76
using Sprache;

NScrape/Properties/AssemblyInfo.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@
3232
// Build Number
3333
// Revision
3434
//
35-
[assembly: AssemblyFileVersion( "0.2.0.0" )]
36-
[assembly: AssemblyInformationalVersion( "0.2.0.0" )]
37-
[assembly: AssemblyVersion( "0.2.0.0" )]
35+
[assembly: AssemblyFileVersion( "0.3.0.0" )]
36+
[assembly: AssemblyInformationalVersion( "0.3.0.0" )]
37+
[assembly: AssemblyVersion( "0.3.0.0" )]

NScrape/WebClient.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -327,9 +327,7 @@ public WebResponse SendRequest( WebRequest webRequest ) {
327327
catch ( WebException ex ) {
328328
response = new ExceptionWebResponse( webRequest.Destination, ex );
329329

330-
if ( webResponse != null ) {
331-
webResponse.Dispose();
332-
}
330+
webResponse?.Dispose();
333331
}
334332

335333
return response;

0 commit comments

Comments
 (0)