public void TestStartup() { // Create a bogus file FileInfo bogusFile = new FileInfo(Path.Combine(_directory.FullName, "bogus")); Assert.IsTrue(bogusFile.CreateEmpty()); // Create the storage now. Bogus files should be gone now DefaultDiskStorage storage = GetStorageSupplier(1).Get(); Assert.IsFalse(bogusFile.Exists); string version1Dir = DefaultDiskStorage.GetVersionSubdirectoryName(1); Assert.IsTrue((new DirectoryInfo(Path.Combine(_directory.FullName, version1Dir))).Exists); // Create a new version storage = GetStorageSupplier(2).Get(); Assert.IsNotNull(storage); Assert.IsFalse((new DirectoryInfo(Path.Combine(_directory.FullName, version1Dir))).Exists); string version2Dir = DefaultDiskStorage.GetVersionSubdirectoryName(2); Assert.IsTrue((new DirectoryInfo(Path.Combine(_directory.FullName, version2Dir))).Exists); }
private static DirectoryInfo GetStorageSubdirectory(DirectoryInfo rootDir, int version) { return(new DirectoryInfo( Path.Combine(rootDir.FullName, DefaultDiskStorage.GetVersionSubdirectoryName(version)))); }