当前位置: 首页>>代码示例>>C#>>正文


C# TemporaryFolder.Dispose方法代码示例

本文整理汇总了C#中SIL.TestUtilities.TemporaryFolder.Dispose方法的典型用法代码示例。如果您正苦于以下问题:C# TemporaryFolder.Dispose方法的具体用法?C# TemporaryFolder.Dispose怎么用?C# TemporaryFolder.Dispose使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SIL.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:jwickberg,项目名称: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:jwickberg,项目名称: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:jwickberg,项目名称: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:jwickberg,项目名称: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:jwickberg,项目名称: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:jwickberg,项目名称: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:jwickberg,项目名称: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:jwickberg,项目名称: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:jwickberg,项目名称:libpalaso,代码行数:8,代码来源:TemporaryFolderTests.cs


注:本文中的SIL.TestUtilities.TemporaryFolder.Dispose方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。