Skip to content

Commit 1b215e0

Browse files
Add coverage for parameter validation
Add code coverage for parameters being null for RegisterBundleAsync().
1 parent 1862dd7 commit 1b215e0

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/HttpClientInterception.Tests/Bundles/BundleExtensionsTests.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,18 @@ public static void RegisterBundle_Validates_Parameters()
310310
Should.Throw<ArgumentNullException>(() => options.RegisterBundle(path, null), "templateValues");
311311
}
312312

313+
[Fact]
314+
public static async Task RegisterBundleAsync_Validates_Parameters()
315+
{
316+
// Arrange
317+
var options = new HttpClientInterceptorOptions();
318+
string path = "foo.bar";
319+
320+
// Act and Assert
321+
await Should.ThrowAsync<ArgumentNullException>(() => ((HttpClientInterceptorOptions)null).RegisterBundleAsync(path), "options");
322+
await Should.ThrowAsync<ArgumentNullException>(() => options.RegisterBundleAsync(null), "path");
323+
}
324+
313325
[Fact]
314326
public static void RegisterBundle_Throws_If_Bundle_Version_Is_Not_Supported()
315327
{

0 commit comments

Comments
 (0)