public void TestInitialize() { string tempPath = Path.GetTempPath(); testPath = Path.Combine(tempPath, Guid.NewGuid().ToString()); Directory.CreateDirectory(testPath); var services = new ServiceCollection(); services.Configure <StoragePoolOptions>(options => { options.Nodes = new Dictionary <string, string> { [testNodeName] = testPath, }; }); services.AddStoragePool(); var serviceProvider = services.BuildServiceProvider(); pool = serviceProvider.GetService <IStoragePool>(); }
private static IStorageNode ExtractPackage(string packageName, Stream package, IStoragePool storagePool) { string packageExtension = GetPackageExtension(packageName); var extractNode = storagePool.GetKnownNode(KnownStorageNodeNames.TestSuite).CreateNode(Guid.NewGuid().ToString()); Utility.ExtractArchive(packageExtension, package, extractNode.AbsolutePath); return(extractNode); }