Skip to content

Commit

Permalink
Fixes tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gehongyan committed May 7, 2024
1 parent 0c470bb commit ba7607b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions test/Kook.Net.Tests.Integration.Socket/MessageTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ await secondMessage.ModifyAsync(x =>

// Clean up
_client.MessageReceived -= ClientOnMessageReceived;
_client.MessageUpdated -= ClientOnMessageUpdated;
return;

Task ClientOnMessageReceived(SocketMessage message, SocketGuildUser author, SocketTextChannel channel)
Expand Down
2 changes: 1 addition & 1 deletion test/Kook.Net.Tests.Unit/UrlValidationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public void UrlValidation_InvalidUrl(string url) =>
[Theory]
[InlineData("http://img.kaiheila.cn/assets/2021-01/7kr4FkWpLV0ku0ku.jpeg")]
[InlineData("https://img.kookapp.cn/assets/2021-01/7kr4FkWpLV0ku0ku.jpeg")]
[InlineData("https://img.kookapp.cn/assets/2021-01/7kr4FkWpLV0ku0ku")]
[InlineData("http://kaiheila.oss-cn-beijing.aliyuncs.com/assets/2021-01/7kr4FkWpLV0ku0ku.jpeg")]
[InlineData("https://img.kookapp.cn/attachments/2022-08/19/GHUrXywopm1hc0u0.png")]
public void UrlValidation_ValidAssetUrl(string url) => Assert.True(UrlValidation.ValidateKookAssetUrl(url));
Expand All @@ -54,7 +55,6 @@ public void UrlValidation_InvalidUrl(string url) =>
[InlineData("steam://run/123456/")]
[InlineData("https://img.kookapp.cn/attachments/2022-08/19/")]
[InlineData("img.kaiheila.cn/assets/2021-01/7kr4FkWpLV0ku0ku.jpeg")]
[InlineData("https://img.kaiheila.cn/assets/2021-01/7kr4FkWpLV0ku0ku")]
[InlineData("https://kaiheila.net/guides/getting_started/images/install/install-vs-dependencies.png")]
public void UrlValidation_InvalidAssetUrl(string url) => Assert.Throws<InvalidOperationException>(() => UrlValidation.ValidateKookAssetUrl(url));
}

0 comments on commit ba7607b

Please sign in to comment.