mirror of
https://github.com/real-zony/ZonyLrcToolsX.git
synced 2025-07-01 12:11:13 +00:00
test: Removed irrelevant tests.
This commit is contained in:
parent
32b6c4052b
commit
9a979942e3
@ -33,7 +33,7 @@ namespace ZonyLrcTools.Tests.Infrastructure.Lyrics
|
||||
await Should.ThrowAsync<ErrorCodeException>(_lyricsProvider.DownloadAsync("天ノ弱", "漆柚").AsTask);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Fact(Skip = "This music already exists KuGou's database.")]
|
||||
public async Task DownloadAsync_Index_Exception_Test()
|
||||
{
|
||||
await Should.ThrowAsync<ErrorCodeException>(async () => await _lyricsProvider.DownloadAsync("40'z", "ZOOLY"));
|
||||
|
@ -113,13 +113,6 @@ namespace ZonyLrcTools.Tests.Infrastructure.Lyrics
|
||||
lyric.IsPruneMusic.ShouldBeTrue();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task DownloadAsync_NullException_Test()
|
||||
{
|
||||
var result = await Should.ThrowAsync<ErrorCodeException>(_lyricsProvider.DownloadAsync("創世記", "りりィ").AsTask);
|
||||
result.ErrorCode.ShouldBe(ErrorCodes.NoMatchingSong);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task DownloadAsync_Source_Null_Test()
|
||||
{
|
||||
|
@ -5,6 +5,7 @@ using Shouldly;
|
||||
using Xunit;
|
||||
using ZonyLrcTools.Common.Configuration;
|
||||
using ZonyLrcTools.Common.Infrastructure.Network;
|
||||
using ZonyLrcTools.Common.Updater;
|
||||
|
||||
namespace ZonyLrcTools.Tests.Infrastructure.Network
|
||||
{
|
||||
@ -25,9 +26,9 @@ namespace ZonyLrcTools.Tests.Infrastructure.Network
|
||||
{
|
||||
var client = ServiceProvider.GetRequiredService<IWarpHttpClient>();
|
||||
|
||||
var response = await client.GetAsync(@"https://www.baidu.com");
|
||||
var response = await client.GetAsync(DefaultUpdater.UpdateUrl);
|
||||
response.ShouldNotBeNull();
|
||||
response.ShouldContain("百度");
|
||||
response.ShouldContain("NewVersion");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@ -39,10 +40,10 @@ namespace ZonyLrcTools.Tests.Infrastructure.Network
|
||||
|
||||
var client = ServiceProvider.GetRequiredService<IWarpHttpClient>();
|
||||
|
||||
var response = await client.GetAsync(@"https://www.baidu.com");
|
||||
var response = await client.GetAsync(DefaultUpdater.UpdateUrl);
|
||||
|
||||
response.ShouldNotBeNull();
|
||||
response.ShouldContain("百度");
|
||||
response.ShouldContain("NewVersion");
|
||||
}
|
||||
}
|
||||
}
|
@ -1,4 +1,5 @@
|
||||
using Shouldly;
|
||||
using System.IO;
|
||||
using Shouldly;
|
||||
using Xunit;
|
||||
using ZonyLrcTools.Common;
|
||||
|
||||
@ -9,7 +10,10 @@ public class MusicInfoTests
|
||||
[Fact]
|
||||
public void InvalidFilePathTest()
|
||||
{
|
||||
var musicInfo = new MusicInfo("C:\\Users\\Zony\\Music\\[ZonyLrcTools]:? - 01. 你好.mp3", "你好", "Zony");
|
||||
musicInfo.FilePath.ShouldBe(@"C:\Users\Zony\Music\[ZonyLrcTools] - 01. 你好.mp3");
|
||||
var tempFilePath = Path.GetTempFileName();
|
||||
var errorFilePath = $"{tempFilePath}" + "?:";
|
||||
|
||||
var musicInfo = new MusicInfo(errorFilePath, "你好", "Zony");
|
||||
musicInfo.FilePath.ShouldBe(tempFilePath);
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user