diff --git a/src/AngleSharp.Io.Tests/Integration/DownloadTests.cs b/src/AngleSharp.Io.Tests/Integration/DownloadTests.cs
index 7ca906a..5540f5a 100644
--- a/src/AngleSharp.Io.Tests/Integration/DownloadTests.cs
+++ b/src/AngleSharp.Io.Tests/Integration/DownloadTests.cs
@@ -67,9 +67,9 @@ public async Task StandardDownloadBinary()
var document = await context.OpenAsync(req => req.Content("Download setup"));
var linkedDownload = await document.QuerySelector("a").NavigateAsync();
- Assert.AreEqual("setup.exe", downloadSeen);
Assert.IsNull(linkedDownload);
Assert.AreEqual(document, context.Active);
+ Assert.AreEqual("setup.exe", downloadSeen);
}
}
}
diff --git a/src/AngleSharp.Io.Tests/Network/FileRequesterTests.cs b/src/AngleSharp.Io.Tests/Network/FileRequesterTests.cs
index 22a81f4..edfbcef 100644
--- a/src/AngleSharp.Io.Tests/Network/FileRequesterTests.cs
+++ b/src/AngleSharp.Io.Tests/Network/FileRequesterTests.cs
@@ -55,8 +55,7 @@ public async Task FollowLinkToUseFileRequesterUsingStandardRequesters()
var context = BrowsingContext.New(config);
var document = await context.OpenAsync(res => res.Content("Download"));
var result = await document.QuerySelector("a").NavigateAsync();
- var content = result.Body.TextContent;
- Assert.AreEqual(0, content.Length);
+ Assert.IsNull(result);
}
}
}
diff --git a/src/AngleSharp.Io.Tests/Network/FtpRequesterTests.cs b/src/AngleSharp.Io.Tests/Network/FtpRequesterTests.cs
index 33f0079..351da6d 100644
--- a/src/AngleSharp.Io.Tests/Network/FtpRequesterTests.cs
+++ b/src/AngleSharp.Io.Tests/Network/FtpRequesterTests.cs
@@ -1,4 +1,4 @@
-namespace AngleSharp.Io.Tests.Network
+namespace AngleSharp.Io.Tests.Network
{
using AngleSharp.Dom;
using AngleSharp.Html.Dom;
@@ -43,8 +43,7 @@ public async Task FollowLinkToUseFtpRequesterUsingStandardRequesters()
var context = BrowsingContext.New(config);
var document = await context.OpenAsync(res => res.Content("Download"));
var result = await document.QuerySelector("a").NavigateAsync();
- var content = result.Body.TextContent;
- Assert.AreEqual(0, content.Length);
+ Assert.IsNull(result);
}
}
}
diff --git a/src/AngleSharp.Io/IoConfigurationExtensions.cs b/src/AngleSharp.Io/IoConfigurationExtensions.cs
index 48c0ed6..1aa36f3 100644
--- a/src/AngleSharp.Io/IoConfigurationExtensions.cs
+++ b/src/AngleSharp.Io/IoConfigurationExtensions.cs
@@ -30,7 +30,10 @@ public static IConfiguration WithDownload(this IConfiguration configuration, Fun
{
var oldFactory = configuration.Services.OfType().FirstOrDefault();
var newFactory = new DownloadFactory(oldFactory, download);
- return configuration.WithOnly(newFactory);
+ return configuration.WithDefaultLoader(new LoaderOptions
+ {
+ Filter = req => false,
+ }).WithOnly(newFactory);
}
///
@@ -133,6 +136,16 @@ public static IConfiguration WithPersistentCookies(this IConfiguration configura
public static IConfiguration WithTemporaryCookies(this IConfiguration configuration) =>
configuration.WithCookies(new MemoryFileHandler());
+ ///
+ /// Registers a non-persistent advanced cookie container using the memory-only file
+ /// handler.
+ /// Alias for WithTemporaryCookies().
+ ///
+ /// The configuration to extend.
+ /// The new instance with the service.
+ public static IConfiguration WithCookies(this IConfiguration configuration) =>
+ configuration.WithTemporaryCookies();
+
///
/// Registers the advanced cookie service.
///
@@ -149,7 +162,7 @@ public static IConfiguration WithCookies(this IConfiguration configuration, ICoo
/// The provider for cookie interactions.
/// The new instance with the service.
public static IConfiguration WithCookies(this IConfiguration configuration, ICookieProvider provider) =>
- configuration.WithOnly(provider);
+ configuration.WithOnly(provider);
#endregion
}