Misc test improvements

This commit is contained in:
Łukasz Domeradzki
2025-02-13 00:20:10 +01:00
parent 52af5c85f0
commit dcde5d9d54
2 changed files with 4 additions and 4 deletions

View File

@@ -106,7 +106,7 @@ internal sealed class Bot {
CreateCard(2, realAppID: appID)
];
Assert.ThrowsException<ArgumentOutOfRangeException>(() => GetItemsForFullBadge(items, 2, appID, MinCardsPerBadge - 1));
Assert.ThrowsExactly<ArgumentOutOfRangeException>(() => GetItemsForFullBadge(items, 2, appID, MinCardsPerBadge - 1));
}
[TestMethod]
@@ -512,7 +512,7 @@ internal sealed class Bot {
CreateCard(4, realAppID: appID0)
];
Assert.ThrowsException<InvalidOperationException>(
Assert.ThrowsExactly<InvalidOperationException>(
() => GetItemsForFullBadge(
items, new Dictionary<uint, byte> {
{ appID0, 3 },

View File

@@ -320,7 +320,7 @@ internal sealed class SteamChatMessage {
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]
@@ -329,7 +329,7 @@ internal sealed class SteamChatMessage {
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