Files
douyin/tests/dy.net.Tests/TestInfrastructure/TemporaryDirectory.cs
T

18 lines
441 B
C#

namespace dy.net.Tests.TestInfrastructure;
internal sealed class TemporaryDirectory : IDisposable
{
public TemporaryDirectory()
{
Path = System.IO.Path.Combine(System.IO.Path.GetTempPath(), "dysync-tests", Guid.NewGuid().ToString("N"));
Directory.CreateDirectory(Path);
}
public string Path { get; }
public void Dispose()
{
if (Directory.Exists(Path)) Directory.Delete(Path, true);
}
}