From 8f79bc2c357b5a3b1cc273d11f640d6502d797be Mon Sep 17 00:00:00 2001 From: Gregory Oschwald Date: Wed, 15 Nov 2023 09:51:32 -0800 Subject: [PATCH] Remove .ConfigureAwait(false) in tests As suggested by analysis warnings --- MaxMind.Db.Test/ReaderTest.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/MaxMind.Db.Test/ReaderTest.cs b/MaxMind.Db.Test/ReaderTest.cs index e5dfe78..dc89d81 100644 --- a/MaxMind.Db.Test/ReaderTest.cs +++ b/MaxMind.Db.Test/ReaderTest.cs @@ -57,7 +57,7 @@ public async Task TestAsync() { var file = Path.Combine(_testDataRoot, "MaxMind-DB-test-ipv" + ipVersion + "-" + recordSize + ".mmdb"); - var reader = await Reader.CreateAsync(file).ConfigureAwait(false); + var reader = await Reader.CreateAsync(file); using (reader) { TestMetadata(reader, ipVersion); @@ -110,7 +110,7 @@ public async Task TestStreamAsync() var file = Path.Combine(_testDataRoot, "MaxMind-DB-test-ipv" + ipVersion + "-" + recordSize + ".mmdb"); using var streamReader = File.OpenText(file); - using var reader = await Reader.CreateAsync(streamReader.BaseStream).ConfigureAwait(false); + using var reader = await Reader.CreateAsync(streamReader.BaseStream); TestMetadata(reader, ipVersion); if (ipVersion == 4) @@ -162,7 +162,7 @@ public async Task TestNonSeekableStreamAsync() "MaxMind-DB-test-ipv" + ipVersion + "-" + recordSize + ".mmdb"); using var stream = new NonSeekableStreamWrapper(File.OpenRead(file)); - using var reader = await Reader.CreateAsync(stream).ConfigureAwait(false); + using var reader = await Reader.CreateAsync(stream); TestMetadata(reader, ipVersion); if (ipVersion == 4) @@ -192,7 +192,7 @@ public void NullStreamThrowsArgumentNullException() public void NullStreamThrowsArgumentNullExceptionAsync() { #pragma warning disable CS8600 // Converting null literal or possible null value to non-nullable type. - ((Func)(async () => await Reader.CreateAsync((Stream)null).ConfigureAwait(false))) + ((Func)(async () => await Reader.CreateAsync((Stream)null))) #pragma warning restore CS8600 // Converting null literal or possible null value to non-nullable type. .Should().ThrowExactlyAsync() .WithMessage("The database stream must not be null.*"); @@ -212,7 +212,7 @@ public void TestEmptyStream() public void TestEmptyStreamAsync() { using var stream = new MemoryStream(); - ((Func)(async () => await Reader.CreateAsync(stream).ConfigureAwait(false))) + ((Func)(async () => await Reader.CreateAsync(stream))) .Should().ThrowExactlyAsync() .WithMessage("*zero bytes left in the stream*"); }