Random temp folder implementation for unit testing
You could easily wind up with collisions on the folder name if the method is called multiple times in very quick succession because of the new Random() being declared for each usage. It should be instantiated once, and since you mentioned it could be called on multiple threads, it should be mutexed onto one at a time. Finally, it's not a good idea to have fields be public - making it a property is luckily pretty easy. So:

public class TempFolder : IDisposable
{
    private static readonly Random _Random = new Random();

    public DirectoryInfo Folder { get; }

    public TempFolder(string prefix = "TempFolder")
    {
        string folderName;

        lock (_Random)
        {
            folderName = prefix + _Random.Next(1000000000);
        }

        Folder = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), folderName));
    }

    public void Dispose()
    {
        Directory.Delete(Folder.FullName, true);
    }
}


Now, what I don't address here is the issue of constructors or the Dispose() method possibly throwing unexpected exceptions. Just know that's a possibility and you may want to catch them and/or re-raise them depending on your use case.