本文整理匯總了C#中Palaso.TestUtilities.TemporaryFolder.GetTemporaryFile方法的典型用法代碼示例。如果您正苦於以下問題:C# TemporaryFolder.GetTemporaryFile方法的具體用法?C# TemporaryFolder.GetTemporaryFile怎麽用?C# TemporaryFolder.GetTemporaryFile使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Palaso.TestUtilities.TemporaryFolder
的用法示例。
在下文中一共展示了TemporaryFolder.GetTemporaryFile方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: Setup
public void Setup()
{
_temporaryFolder = new TemporaryFolder();
string filePath = _temporaryFolder.GetTemporaryFile();
_repository = new LiftLexEntryRepository(filePath);
_headwordWritingSystem = new WritingSystemDefinition("th");
}
示例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));
}
示例5: Setup
public void Setup()
{
_tempfolder = new TemporaryFolder();
string persistedFilePath = _tempfolder.GetTemporaryFile();
_repository = new LiftLexEntryRepository(persistedFilePath);
}