Exemplo n.º 1
0
 private TestEnvironment(ITestOutputHelper output, string torControlPassword, string baseDirectory, ReservedPorts ports)
 {
     _output             = output;
     _baseDirectory      = baseDirectory;
     _torControlPassword = torControlPassword;
     _ports           = ports;
     _disposed        = false;
     _deleteOnDispose = true;
 }
Exemplo n.º 2
0
 private TestEnvironment(ITestOutputHelper output, string torControlPassword, string baseDirectory, ReservedPorts ports)
 {
     _output = output;
     _baseDirectory = baseDirectory;
     _torControlPassword = torControlPassword;
     _ports = ports;
     _disposed = false;
     _deleteOnDispose = true;
 }
Exemplo n.º 3
0
        public static TestEnvironment Initialize(ITestOutputHelper output)
        {
            var guid          = Guid.NewGuid().ToString("N");
            var baseDirectory = Path.Combine(Path.GetTempPath(), "Knapcode.TorSharp.Tests", guid);

            output.WriteLine($"Initializing test environment in base directory: {baseDirectory}");

            var ports = ReservedPorts.Reserve(3);

            output.WriteLine($"Reserved ports: {string.Join(", ", ports.Ports)}");

            Directory.CreateDirectory(baseDirectory);

            return(new TestEnvironment(output, guid, baseDirectory, ports));
        }