當前位置: 首頁>>代碼示例>>C#>>正文


C# TemporaryFolder.Dispose方法代碼示例

本文整理匯總了C#中Palaso.TestUtilities.TemporaryFolder.Dispose方法的典型用法代碼示例。如果您正苦於以下問題:C# TemporaryFolder.Dispose方法的具體用法?C# TemporaryFolder.Dispose怎麽用?C# TemporaryFolder.Dispose使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Palaso.TestUtilities.TemporaryFolder的用法示例。


在下文中一共展示了TemporaryFolder.Dispose方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Constructor_PathDirectoryName_CreatesTemporarySubDirectoryAtPathWithGivenName

		public void Constructor_PathDirectoryName_CreatesTemporarySubDirectoryAtPathWithGivenName()
		{
			TemporaryFolder temporaryFolder = new TemporaryFolder("Constructor_PathDirectoryName_CreatesTemporarySubDirectoryAtPathWithGivenName");
			Assert.IsTrue(Directory.Exists(temporaryFolder.FolderPath));
			temporaryFolder.Dispose();
			Assert.IsFalse(Directory.Exists(temporaryFolder.Path));
		}
開發者ID:JohnThomson,項目名稱:libpalaso,代碼行數:7,代碼來源:TemporaryFolderTests.cs

示例2: Constructor_CreatesTemporarySubDirectory

		public void Constructor_CreatesTemporarySubDirectory()
		{
			var temporaryFolder = new TemporaryFolder();
			Assert.IsTrue(Directory.Exists(temporaryFolder.FolderPath));
			temporaryFolder.Dispose();
			Assert.IsFalse(Directory.Exists(temporaryFolder.Path));
		}
開發者ID:JohnThomson,項目名稱:libpalaso,代碼行數:7,代碼來源:TemporaryFolderTests.cs

示例3: GetTemporaryFile_FileExistsInTemporarySubdirectory

		public void GetTemporaryFile_FileExistsInTemporarySubdirectory()
		{
			TemporaryFolder temporaryFolder = new TemporaryFolder();
			string pathToFile = temporaryFolder.GetTemporaryFile();
			Assert.IsTrue(File.Exists(pathToFile));
			temporaryFolder.Dispose();
			Assert.IsFalse(Directory.Exists(temporaryFolder.Path));
		}
開發者ID:JohnThomson,項目名稱:libpalaso,代碼行數:8,代碼來源:TemporaryFolderTests.cs

示例4: GetTemporaryFile_CalledTwice_BothFilesFoundInSameTemporarySubdirectory

		public void GetTemporaryFile_CalledTwice_BothFilesFoundInSameTemporarySubdirectory()
		{
			TemporaryFolder temporaryFolder = new TemporaryFolder();
			temporaryFolder.GetTemporaryFile();
			temporaryFolder.GetTemporaryFile();
			Assert.AreEqual(2, Directory.GetFiles(temporaryFolder.Path).Length);
			temporaryFolder.Dispose();
			Assert.IsFalse(Directory.Exists(temporaryFolder.Path));
		}
開發者ID:JohnThomson,項目名稱:libpalaso,代碼行數:9,代碼來源:TemporaryFolderTests.cs

示例5: GetTemporaryFile_Name_FileWithNameExistsInTemporarySubdirectory

		public void GetTemporaryFile_Name_FileWithNameExistsInTemporarySubdirectory()
		{
			TemporaryFolder temporaryFolder = new TemporaryFolder();
			string pathToFile = temporaryFolder.GetTemporaryFile("blah");
			Assert.IsTrue(File.Exists(pathToFile));
			Assert.AreEqual(pathToFile, Path.Combine(temporaryFolder.Path, "blah"));
			temporaryFolder.Dispose();
			Assert.IsFalse(Directory.Exists(temporaryFolder.Path));
		}
開發者ID:JohnThomson,項目名稱:libpalaso,代碼行數:9,代碼來源:TemporaryFolderTests.cs

示例6: Constructor_TemporarySubDirectoryAlreadyExistsAndHasFilesInIt_EmptyTheTemporarySubDirectory

		public void Constructor_TemporarySubDirectoryAlreadyExistsAndHasFilesInIt_EmptyTheTemporarySubDirectory()
		{
			TemporaryFolder temporaryFolder = new TemporaryFolder("NonStandard");
			string pathToFile = Path.Combine(temporaryFolder.Path, Path.GetRandomFileName());
			FileStream file = File.Create(pathToFile);
			file.Close();
			TemporaryFolder temporaryFolderUsingSameDirectory = new TemporaryFolder("NonStandard");
			Assert.AreEqual(0, Directory.GetFiles(temporaryFolder.Path).Length);
			temporaryFolder.Dispose();
			Assert.IsFalse(Directory.Exists(temporaryFolder.Path));
			Assert.IsFalse(Directory.Exists(temporaryFolderUsingSameDirectory.Path));
		}
開發者ID:JohnThomson,項目名稱:libpalaso,代碼行數:12,代碼來源:TemporaryFolderTests.cs

示例7: CreateRampPackageWithSessionArchiveAndMetsFile_CreatesRampPackage

 public void CreateRampPackageWithSessionArchiveAndMetsFile_CreatesRampPackage()
 {
     TemporaryFolder tmpFolder = new TemporaryFolder("ArchiveHelperTestFolder");
     try
     {
         string fileName = Path.Combine(tmpFolder.Path, "ddo.session");
         File.CreateText(fileName).Close();
         var fileList = new[] { Path.Combine(tmpFolder.Path, "ddo.session") };
         _filesToAdd.Add(string.Empty, new Tuple<IEnumerable<string>, string>(fileList, "Message to display."));
         _helper.Initialize();
         _helper.CreateMetsFile();
         Assert.IsTrue(_helper.CreateRampPackage());
         Assert.IsTrue(File.Exists(_helper.PackagePath));
     }
     finally
     {
         tmpFolder.Dispose();
     }
 }
開發者ID:neilmayhew,項目名稱:libpalaso,代碼行數:19,代碼來源:RampArchivingDlgViewModelTests.cs

示例8: Delete_FileInDirectory_RemovesTemporaryDirectory

		public void Delete_FileInDirectory_RemovesTemporaryDirectory()
		{
			TemporaryFolder temporaryFolder = new TemporaryFolder("NonStandard");
			string pathToFile = Path.Combine(temporaryFolder.FolderPath, Path.GetRandomFileName());
			FileStream file = File.Create(pathToFile);
			file.Close();
			temporaryFolder.Dispose();
			Assert.IsFalse(Directory.Exists(temporaryFolder.Path));
		}
開發者ID:JohnThomson,項目名稱:libpalaso,代碼行數:9,代碼來源:TemporaryFolderTests.cs

示例9: Delete_SubDirectoriesInDirectory_RemovesTemporaryDirectory

		public void Delete_SubDirectoriesInDirectory_RemovesTemporaryDirectory()
		{
			TemporaryFolder temporaryFolder = new TemporaryFolder("NonStandard");
			string pathToSubdirectory = Path.Combine(temporaryFolder.Path, Path.GetRandomFileName());
			Directory.CreateDirectory(pathToSubdirectory);
			temporaryFolder.Dispose();
			Assert.IsFalse(Directory.Exists(temporaryFolder.Path));
		}
開發者ID:JohnThomson,項目名稱:libpalaso,代碼行數:8,代碼來源:TemporaryFolderTests.cs


注:本文中的Palaso.TestUtilities.TemporaryFolder.Dispose方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。