Skip to content

Commit

Permalink
Remove .ConfigureAwait(false) in tests
Browse files Browse the repository at this point in the history
As suggested by analysis warnings
  • Loading branch information
oschwald committed Nov 15, 2023
1 parent b053713 commit 8f79bc2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions MaxMind.Db.Test/ReaderTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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<Task>)(async () => await Reader.CreateAsync((Stream)null).ConfigureAwait(false)))
((Func<Task>)(async () => await Reader.CreateAsync((Stream)null)))
#pragma warning restore CS8600 // Converting null literal or possible null value to non-nullable type.
.Should().ThrowExactlyAsync<ArgumentNullException>()
.WithMessage("The database stream must not be null.*");
Expand All @@ -212,7 +212,7 @@ public void TestEmptyStream()
public void TestEmptyStreamAsync()
{
using var stream = new MemoryStream();
((Func<Task>)(async () => await Reader.CreateAsync(stream).ConfigureAwait(false)))
((Func<Task>)(async () => await Reader.CreateAsync(stream)))
.Should().ThrowExactlyAsync<InvalidDatabaseException>()
.WithMessage("*zero bytes left in the stream*");
}
Expand Down

0 comments on commit 8f79bc2

Please sign in to comment.