Skip to content

Commit

Permalink
Misc test improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
JustArchi committed Feb 12, 2025
1 parent 52af5c8 commit dcde5d9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions ArchiSteamFarm.Tests/Bot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ internal void MaxItemsTooSmall() {
CreateCard(2, realAppID: appID)
];

Assert.ThrowsException<ArgumentOutOfRangeException>(() => GetItemsForFullBadge(items, 2, appID, MinCardsPerBadge - 1));
Assert.ThrowsExactly<ArgumentOutOfRangeException>(() => GetItemsForFullBadge(items, 2, appID, MinCardsPerBadge - 1));
}

[TestMethod]
Expand Down Expand Up @@ -512,7 +512,7 @@ internal void TooManyCardsPerSet() {
CreateCard(4, realAppID: appID0)
];

Assert.ThrowsException<InvalidOperationException>(
Assert.ThrowsExactly<InvalidOperationException>(
() => GetItemsForFullBadge(
items, new Dictionary<uint, byte> {
{ appID0, 3 },
Expand Down
4 changes: 2 additions & 2 deletions ArchiSteamFarm.Tests/SteamChatMessage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ internal async Task ThrowsOnTooLongNewlinesPrefix() {

const string message = "asdf";

await Assert.ThrowsExceptionAsync<ArgumentOutOfRangeException>(async () => await GetMessageParts(message, prefix).ToListAsync().ConfigureAwait(false)).ConfigureAwait(false);
await Assert.ThrowsExactlyAsync<ArgumentOutOfRangeException>(async () => await GetMessageParts(message, prefix).ToListAsync().ConfigureAwait(false)).ConfigureAwait(false);
}

[TestMethod]
Expand All @@ -329,7 +329,7 @@ internal async Task ThrowsOnTooLongPrefix() {

const string message = "asdf";

await Assert.ThrowsExceptionAsync<ArgumentOutOfRangeException>(async () => await GetMessageParts(message, prefix).ToListAsync().ConfigureAwait(false)).ConfigureAwait(false);
await Assert.ThrowsExactlyAsync<ArgumentOutOfRangeException>(async () => await GetMessageParts(message, prefix).ToListAsync().ConfigureAwait(false)).ConfigureAwait(false);
}
}
#pragma warning restore CA1812 // False positive, the class is used during MSTest

0 comments on commit dcde5d9

Please sign in to comment.