本文整理汇总了C#中SIL.TestUtilities.TemporaryFolder.GetTemporaryFile方法的典型用法代码示例。如果您正苦于以下问题:C# TemporaryFolder.GetTemporaryFile方法的具体用法?C# TemporaryFolder.GetTemporaryFile怎么用?C# TemporaryFolder.GetTemporaryFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SIL.TestUtilities.TemporaryFolder
的用法示例。
在下文中一共展示了TemporaryFolder.GetTemporaryFile方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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));
}
示例2: TestEnvironment
public TestEnvironment()
{
_temporaryFolder = new TemporaryFolder("LiftLexEntryRepositoryTests");
string filePath = _temporaryFolder.GetTemporaryFile();
_repository = new LiftLexEntryRepository(filePath);
_headwordWritingSystem = new WritingSystemDefinition("th") {DefaultCollation = new IcuRulesCollationDefinition("standard")};
}
示例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));
}
示例4: 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));
}