FFMpegCore/FFMpegCore.Test/TemporaryFile.cs
Malte Rosenbjerg f9f7161686
Cleanup after splitting into two packages (#386)
* Move PosterWithAudio to FFMpegCore

* Reduce windows only tests

* Update Directory.Build.props

* Create .editorconfig

* More cleanup

* Enable implicit usings

* Remove unused method

* Apply dotnet format

* Fix unused variable in AudioGateArgument

* Fix boolean conditions in AudioGateArgument

* Merge boolean conditions into pattern

* Use target-typed new

* Add linting to CI

* Add CUDA to HardwareAccelerationDevice enum

* Increase timeout for Video_Join_Image_Sequence

* Adjust Video_Join_Image_Sequence timeout

* Fix expected seconds in Video_Join_Image_Sequence

* Increase timeout for Video_TranscodeToMemory due to macos agents
2023-02-02 21:19:45 +01:00

21 lines
533 B
C#

namespace FFMpegCore.Test
{
public class TemporaryFile : IDisposable
{
private readonly string _path;
public TemporaryFile(string filename)
{
_path = Path.Combine(Path.GetTempPath(), $"{Guid.NewGuid()}-{filename}");
}
public static implicit operator string(TemporaryFile temporaryFile) => temporaryFile._path;
public void Dispose()
{
if (File.Exists(_path))
{
File.Delete(_path);
}
}
}
}