From 2258126110e2d840d9a496527a1bf30223fa1ef8 Mon Sep 17 00:00:00 2001 From: d4n Date: Wed, 29 May 2024 15:31:10 -0500 Subject: [PATCH] Fix tests --- tests/Fergun.Tests/Modules/ImageModuleTests.cs | 6 +++--- tests/Fergun.Tests/Modules/OcrModuleTests.cs | 4 ++-- tests/Fergun.Tests/Modules/SharedModuleTests.cs | 8 ++++---- tests/Fergun.Tests/Modules/UtilityModuleTests.cs | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/Fergun.Tests/Modules/ImageModuleTests.cs b/tests/Fergun.Tests/Modules/ImageModuleTests.cs index d4b7048..a4f2c6b 100644 --- a/tests/Fergun.Tests/Modules/ImageModuleTests.cs +++ b/tests/Fergun.Tests/Modules/ImageModuleTests.cs @@ -73,7 +73,7 @@ public async Task GoogleAsync_Sends_Paginator(string query, bool multiImages, bo channel.VerifyGet(x => x.IsNsfw); _interactionMock.Verify(x => x.FollowupWithFilesAsync(It.IsAny>(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), - It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny()), Times.Once); + It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny()), Times.Once); } [Fact] @@ -103,7 +103,7 @@ public async Task DuckDuckGoAsync_Sends_Paginator(string query, bool multiImages channel.VerifyGet(x => x.IsNsfw); _interactionMock.Verify(x => x.FollowupWithFilesAsync(It.IsAny>(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), - It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny()), Times.Once); + It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny()), Times.Once); } [Fact] @@ -130,7 +130,7 @@ public async Task ReverseAsync_Sends_Paginator(string? url, IAttachment? file, R _interactionMock.VerifyGet(x => x.User); _interactionMock.Verify(x => x.DeferAsync(It.Is(b => !b), It.IsAny()), Times.Once); _interactionMock.Verify(x => x.FollowupWithFilesAsync(It.IsAny>(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), - It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny()), Times.Once); + It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny()), Times.Once); if (engine == ReverseImageSearchEngine.Bing) { diff --git a/tests/Fergun.Tests/Modules/OcrModuleTests.cs b/tests/Fergun.Tests/Modules/OcrModuleTests.cs index 488cd9f..8f452ce 100644 --- a/tests/Fergun.Tests/Modules/OcrModuleTests.cs +++ b/tests/Fergun.Tests/Modules/OcrModuleTests.cs @@ -68,7 +68,7 @@ public async Task GoogleAsync_Uses_GoogleLens(string url, bool success) _googleLensMock.Verify(x => x.OcrAsync(It.Is(s => s == url), It.IsAny()), Times.Once); _interactionMock.Verify(x => x.FollowupAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.Is(b => b == isEphemeral), - It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny()), success ? Times.Once : Times.Never); + It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny()), success ? Times.Once : Times.Never); } [Theory] @@ -87,7 +87,7 @@ public async Task YandexAsync_Uses_YandexImageSearch(string url, bool success) _yandexImageSearchMock.Verify(x => x.OcrAsync(It.Is(s => s == url), It.IsAny()), Times.Once); _interactionMock.Verify(x => x.FollowupAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.Is(b => b == isEphemeral), - It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny()), success ? Times.Once : Times.Never); + It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny()), success ? Times.Once : Times.Never); } [Fact] diff --git a/tests/Fergun.Tests/Modules/SharedModuleTests.cs b/tests/Fergun.Tests/Modules/SharedModuleTests.cs index 2a32f86..8e3239e 100644 --- a/tests/Fergun.Tests/Modules/SharedModuleTests.cs +++ b/tests/Fergun.Tests/Modules/SharedModuleTests.cs @@ -81,7 +81,7 @@ public async Task TranslateAsync_Returns_Results_Or_Fails_Preconditions(string? _translatorMock.Verify(x => x.TranslateAsync(It.Is(s => s == text), It.Is(s => s == target), It.Is(s => s == source)), passedPreconditions ? Times.Once : Times.Never); _interactionMock.Verify(x => x.FollowupAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.Is(b => b == ephemeral), - It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny()), result.IsSuccess && passedPreconditions ? Times.Once : Times.Never); + It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny()), result.IsSuccess && passedPreconditions ? Times.Once : Times.Never); } [Theory] @@ -101,7 +101,7 @@ public async Task TranslateAsync_Uses_DeferLoadingAsync(string text, string targ _translatorMock.Verify(x => x.TranslateAsync(It.Is(s => s == text), It.Is(s => s == target), It.Is(s => s == source)), Times.Once); _componentInteractionMock.Verify(x => x.FollowupAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.Is(b => b == ephemeral), - It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny()), Times.Once); + It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny()), Times.Once); } [Theory] @@ -122,7 +122,7 @@ public async Task TtsAsync_Sends_Results_Or_Fails_Preconditions(string text, str _interactionMock.Verify(x => x.DeferAsync(It.Is(b => b == ephemeral), It.IsAny()), passedPreconditions ? Times.Once : Times.Never); _interactionMock.Verify(x => x.FollowupWithFileAsync(It.Is(f => f.FileName == "tts.mp3"), It.IsAny(), It.IsAny(), It.IsAny(), It.Is(b => b == ephemeral), - It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny()), passedPreconditions ? Times.Once : Times.Never); + It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny()), passedPreconditions ? Times.Once : Times.Never); } [Theory] @@ -138,6 +138,6 @@ public async Task TtsAsync_Uses_DeferLoadingAsync(string text, string target, bo _componentInteractionMock.Verify(x => x.DeferLoadingAsync(It.Is(b => b == ephemeral), It.IsAny()), Times.Once); _componentInteractionMock.Verify(x => x.FollowupWithFileAsync(It.Is(f => f.FileName == "tts.mp3"), It.IsAny(), It.IsAny(), It.IsAny(), It.Is(b => b == ephemeral), - It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny()), Times.Once); + It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny()), Times.Once); } } \ No newline at end of file diff --git a/tests/Fergun.Tests/Modules/UtilityModuleTests.cs b/tests/Fergun.Tests/Modules/UtilityModuleTests.cs index f34b449..579906d 100644 --- a/tests/Fergun.Tests/Modules/UtilityModuleTests.cs +++ b/tests/Fergun.Tests/Modules/UtilityModuleTests.cs @@ -131,7 +131,7 @@ internal void VerifyRespondAsyncCall(IUser user) { _interactionMock.Verify(x => x.RespondAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), - It.Is(e => EmbedImageUrlIsUserAvatarUrl(user, e)), It.IsAny()), Times.Once); + It.Is(e => EmbedImageUrlIsUserAvatarUrl(user, e)), It.IsAny(), It.IsAny()), Times.Once); } public static bool EmbedImageUrlIsUserAvatarUrl(IUser user, Embed embed)