mirror of
https://github.com/real-zony/ZonyLrcToolsX.git
synced 2025-08-31 17:56:53 +00:00
fix: Fixed the path issue #128.
We should avoid using the Directory.GetCurrentDirectory() method, as it can result in retrieving incorrect paths.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
@@ -20,7 +21,7 @@ namespace ZonyLrcTools.Tests.Infrastructure.Album
|
||||
albumBytes.Length.ShouldBeGreaterThan(0);
|
||||
|
||||
// 显示具体的图像。
|
||||
var tempAlbumPath = Path.Combine(Directory.GetCurrentDirectory(), "tempAlbum.png");
|
||||
var tempAlbumPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "tempAlbum.png");
|
||||
File.Delete(tempAlbumPath);
|
||||
|
||||
await using var file = File.Create(tempAlbumPath);
|
||||
|
@@ -1,9 +1,9 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Shouldly;
|
||||
using Xunit;
|
||||
using ZonyLrcTools.Cli.Infrastructure.Tag;
|
||||
using ZonyLrcTools.Common.TagInfo;
|
||||
|
||||
namespace ZonyLrcTools.Tests.Infrastructure.Tag
|
||||
@@ -16,7 +16,7 @@ namespace ZonyLrcTools.Tests.Infrastructure.Tag
|
||||
var tagLoader = ServiceProvider.GetRequiredService<ITagLoader>();
|
||||
|
||||
tagLoader.ShouldNotBeNull();
|
||||
var info = await tagLoader.LoadTagAsync(Path.Combine(Directory.GetCurrentDirectory(), "MusicFiles", "曾经艺也 - 荀彧(纯音乐版).mp3"));
|
||||
var info = await tagLoader.LoadTagAsync(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "MusicFiles", "曾经艺也 - 荀彧(纯音乐版).mp3"));
|
||||
info.ShouldNotBeNull();
|
||||
info.Name.ShouldBe("荀彧(纯音乐版)");
|
||||
info.Artist.ShouldBe("曾经艺也");
|
||||
|
Reference in New Issue
Block a user