build: initial project release
This commit is contained in:
commit
e313a60138
59 changed files with 4903 additions and 0 deletions
34
src/process.tests/_fixture/TestTempDirectory.cs
Normal file
34
src/process.tests/_fixture/TestTempDirectory.cs
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
// Copyright (c) The Geekeey Authors
|
||||
// SPDX-License-Identifier: EUPL-1.2
|
||||
|
||||
namespace Geekeey.Process.Tests;
|
||||
|
||||
internal sealed class TestTempDirectory : IDisposable
|
||||
{
|
||||
private TestTempDirectory(string path)
|
||||
{
|
||||
Path = path;
|
||||
}
|
||||
|
||||
public static TestTempDirectory Create()
|
||||
{
|
||||
var location = System.Reflection.Assembly.GetExecutingAssembly().Location;
|
||||
var pwd = System.IO.Path.GetDirectoryName(location) ?? Directory.GetCurrentDirectory();
|
||||
var dirPath = System.IO.Path.Combine(pwd, "Temp", Guid.NewGuid().ToString());
|
||||
|
||||
Directory.CreateDirectory(dirPath);
|
||||
|
||||
return new TestTempDirectory(dirPath);
|
||||
}
|
||||
|
||||
public string Path { get; }
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
try
|
||||
{
|
||||
Directory.Delete(Path, recursive: true);
|
||||
}
|
||||
catch (DirectoryNotFoundException) { }
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue