From dcde5d9d54bee174e98b9b36971d401c79339187 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Domeradzki?= Date: Thu, 13 Feb 2025 00:20:10 +0100 Subject: [PATCH] Misc test improvements --- ArchiSteamFarm.Tests/Bot.cs | 4 ++-- ArchiSteamFarm.Tests/SteamChatMessage.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ArchiSteamFarm.Tests/Bot.cs b/ArchiSteamFarm.Tests/Bot.cs index 59e654ca18ddb..8b72ec8c56dc2 100644 --- a/ArchiSteamFarm.Tests/Bot.cs +++ b/ArchiSteamFarm.Tests/Bot.cs @@ -106,7 +106,7 @@ internal void MaxItemsTooSmall() { CreateCard(2, realAppID: appID) ]; - Assert.ThrowsException(() => GetItemsForFullBadge(items, 2, appID, MinCardsPerBadge - 1)); + Assert.ThrowsExactly(() => GetItemsForFullBadge(items, 2, appID, MinCardsPerBadge - 1)); } [TestMethod] @@ -512,7 +512,7 @@ internal void TooManyCardsPerSet() { CreateCard(4, realAppID: appID0) ]; - Assert.ThrowsException( + Assert.ThrowsExactly( () => GetItemsForFullBadge( items, new Dictionary { { appID0, 3 }, diff --git a/ArchiSteamFarm.Tests/SteamChatMessage.cs b/ArchiSteamFarm.Tests/SteamChatMessage.cs index 2224d35329b6e..798af1cd9264a 100644 --- a/ArchiSteamFarm.Tests/SteamChatMessage.cs +++ b/ArchiSteamFarm.Tests/SteamChatMessage.cs @@ -320,7 +320,7 @@ internal async Task ThrowsOnTooLongNewlinesPrefix() { const string message = "asdf"; - await Assert.ThrowsExceptionAsync(async () => await GetMessageParts(message, prefix).ToListAsync().ConfigureAwait(false)).ConfigureAwait(false); + await Assert.ThrowsExactlyAsync(async () => await GetMessageParts(message, prefix).ToListAsync().ConfigureAwait(false)).ConfigureAwait(false); } [TestMethod] @@ -329,7 +329,7 @@ internal async Task ThrowsOnTooLongPrefix() { const string message = "asdf"; - await Assert.ThrowsExceptionAsync(async () => await GetMessageParts(message, prefix).ToListAsync().ConfigureAwait(false)).ConfigureAwait(false); + await Assert.ThrowsExactlyAsync(async () => await GetMessageParts(message, prefix).ToListAsync().ConfigureAwait(false)).ConfigureAwait(false); } } #pragma warning restore CA1812 // False positive, the class is used during MSTest