feat: Provide the 'isOnlyOutputTranslation option to output only translated lyrics.

This commit is contained in:
real-zony
2022-09-22 15:48:20 +08:00
parent be4380c744
commit 8385f6f118
4 changed files with 29 additions and 5 deletions

View File

@@ -1,8 +1,11 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using Shouldly;
using Xunit;
using ZonyLrcTools.Cli.Config;
using ZonyLrcTools.Cli.Infrastructure.Lyric;
namespace ZonyLrcTools.Tests.Infrastructure.Lyric
@@ -84,5 +87,15 @@ namespace ZonyLrcTools.Tests.Infrastructure.Lyric
var lyric = await _lyricDownloader.DownloadAsync("君への嘘", "VALSHE");
lyric.ShouldNotBeEmpty();
}
[Fact]
public async Task DownloadAsync_Issue114_Test()
{
var options = ServiceProvider.GetRequiredService<IOptions<ToolOptions>>();
options.Value.Provider.Lyric.Config.IsOnlyOutputTranslation = true;
var lyric = await _lyricDownloader.DownloadAsync("Bones", "Image Dragons");
lyric.ToString().ShouldNotContain("Gimme, gimme, gimme some time to think");
}
}
}