mirror of
https://github.com/real-zony/ZonyLrcToolsX.git
synced 2025-08-31 17:56:53 +00:00
feat: Added support for reading song list from Csv file.
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
using Shouldly;
|
||||
using Xunit;
|
||||
using ZonyLrcTools.Common.MusicScanner;
|
||||
|
||||
namespace ZonyLrcTools.Tests.MusicScanner;
|
||||
|
||||
public class CsvFileMusicScannerTests : TestBase
|
||||
{
|
||||
[Fact]
|
||||
public async Task GetMusicInfoFromCsvFileAsync_Test()
|
||||
{
|
||||
var musicScanner = GetService<CsvFileMusicScanner>();
|
||||
var musicInfo = await musicScanner.GetMusicInfoFromCsvFileAsync(Path.Combine("TestData", "test.csv"), new ManualDownloadOptions());
|
||||
|
||||
musicInfo.ShouldNotBeNull();
|
||||
musicInfo.Count.ShouldBeGreaterThan(0);
|
||||
musicInfo.Count.ShouldBe(5);
|
||||
}
|
||||
}
|
6
tests/ZonyLrcTools.Tests/TestData/test.csv
Normal file
6
tests/ZonyLrcTools.Tests/TestData/test.csv
Normal file
@@ -0,0 +1,6 @@
|
||||
Song,Artist
|
||||
刀马旦,李玟
|
||||
发如雪,周杰伦
|
||||
说书人,寅子
|
||||
爱的供养,张国荣
|
||||
七里香,周杰伦
|
|
@@ -33,6 +33,9 @@
|
||||
<Content Include="MusicFiles\Loren Gray - Queen.ncm">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<None Update="TestData\test.csv">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
Reference in New Issue
Block a user