mirror of
https://github.com/real-zony/ZonyLrcToolsX.git
synced 2025-09-07 06:06:53 +00:00
feat: Reinitialize the Repository.
重新初始化仓库。
This commit is contained in:
31
tests/ZonyLrcTools.Tests/FileScannerTests.cs
Normal file
31
tests/ZonyLrcTools.Tests/FileScannerTests.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Shouldly;
|
||||
using Xunit;
|
||||
using ZonyLrcTools.Cli.Infrastructure.IO;
|
||||
|
||||
namespace ZonyLrcTools.Tests
|
||||
{
|
||||
public class FileScannerTests : TestBase
|
||||
{
|
||||
[Fact]
|
||||
public async Task ScanAsync_Test()
|
||||
{
|
||||
var tempMusicFilePath = Path.Combine(Directory.GetCurrentDirectory(), "Temp.mp3");
|
||||
File.Create(tempMusicFilePath);
|
||||
|
||||
var fileScanner = ServiceProvider.GetRequiredService<IFileScanner>();
|
||||
var result = await fileScanner.ScanAsync(
|
||||
Path.GetDirectoryName(tempMusicFilePath),
|
||||
new[] {"*.mp3", "*.flac"});
|
||||
|
||||
result.Count.ShouldBe(2);
|
||||
result.First(e => e.ExtensionName == ".mp3").FilePaths.Count.ShouldNotBe(0);
|
||||
|
||||
File.Delete(tempMusicFilePath);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user