Skip to content

Commit

Permalink
Add test for bad request
Browse files Browse the repository at this point in the history
In this test, the web request triggers an exception which should be
correctly caught by the store methods.
  • Loading branch information
smoogipoo committed May 13, 2024
1 parent 0be298d commit 96deaf7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions osu.Framework.Tests/IO/TestOnlineStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,5 +107,15 @@ public void TestFileUrlFails([Values(true, false)] bool async)

Assert.That(result, Is.Null);
}

[Test]
public void TestBadWebRequest([ValueSource(nameof(protocols))] string protocol, [Values(true, false)] bool async)
{
byte[]? result = async
? store.GetAsync($"{protocol}://{host}/status/500").GetResultSafely()
: store.Get($"{protocol}://{host}/status/500");

Assert.That(result, Is.Null);
}
}
}

0 comments on commit 96deaf7

Please sign in to comment.