本文整理汇总了C#中Palaso.TestUtilities.TemporaryFolder类的典型用法代码示例。如果您正苦于以下问题:C# TemporaryFolder类的具体用法?C# TemporaryFolder怎么用?C# TemporaryFolder使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TemporaryFolder类属于Palaso.TestUtilities命名空间,在下文中一共展示了TemporaryFolder类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Constructor_CreatesTemporarySubDirectory
public void Constructor_CreatesTemporarySubDirectory()
{
var temporaryFolder = new TemporaryFolder();
Assert.IsTrue(Directory.Exists(temporaryFolder.FolderPath));
temporaryFolder.Dispose();
Assert.IsFalse(Directory.Exists(temporaryFolder.Path));
}
示例2: HgTestSetup
public HgTestSetup()
{
_progress = new ConsoleProgress();
Root = new TemporaryFolder("ChorusHgWrappingTest");
HgRepository.CreateRepositoryInExistingDir(Root.Path,_progress);
Repository = new HgRepository(Root.Path, new NullProgress());
}
示例3: Constructor_Path_CreatesTemporarySubDirectoryAtPath
public void Constructor_Path_CreatesTemporarySubDirectoryAtPath()
{
using (TemporaryFolder temporaryFolder = new TemporaryFolder("foo"))
{
Assert.IsTrue(Directory.Exists(temporaryFolder.FolderPath));
}
}
示例4: Setup
public void Setup()
{
_temporaryFolder = new TemporaryFolder();
string filePath = _temporaryFolder.GetTemporaryFile();
_repository = new LiftLexEntryRepository(filePath);
_headwordWritingSystem = new WritingSystemDefinition("th");
}
示例5: 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));
}
示例6: Setup
public void Setup()
{
ErrorReport.IsOkToInteractWithUser = false;
_tmpFolder = new TemporaryFolder("IMDIArchiveHelperTestFolder");
_model = new IMDIArchivingDlgViewModel(kAppName, kTitle, kArchiveId, null, true,
SetFilesToArchive, _tmpFolder.Path);
}
示例7: RepositorySetup
public RepositorySetup(string userName, string projectfolder)
{
Progress = new NullProgress();
ProjectFolder = new TemporaryFolder(projectfolder);
MakeRepositoryForTest(ProjectFolder.Path, userName, Progress);
ProjectFolderConfig = new ProjectFolderConfiguration(ProjectFolder.Path);
}
示例8: Constructor_CreatesFolders
public void Constructor_CreatesFolders()
{
using (var e = new TemporaryFolder("GlobalWritingSystemRepositoryTests"))
{
var repo = new GlobalWritingSystemRepository(e.Path);
Assert.That(Directory.Exists(repo.PathToWritingSystems), Is.True);
}
}
示例9: PathConstructor_HasCorrectPath
public void PathConstructor_HasCorrectPath()
{
using (var e = new TemporaryFolder("GlobalWritingSystemRepositoryTests"))
{
var repo = new GlobalWritingSystemRepository(e.Path);
Assert.That(repo.PathToWritingSystems, Is.StringMatching(".*GlobalWritingSystemRepositoryTests.2"));
}
}
示例10: Launch_CloseAfterAFewSeconds_DoesntCrash
public void Launch_CloseAfterAFewSeconds_DoesntCrash()
{
using (var folder = new TemporaryFolder("ChorusApplicationTests"))
{
Application.Idle += new EventHandler(Application_Idle);
new Program.Runner().Run(folder.Path, new Arguments(new object[]{}));
}
}
示例11: TempLiftFile
public TempLiftFile(string fileName, TemporaryFolder parentFolder, string xmlOfEntries, string claimedLiftVersion)
: base(true) // True means "I'll set the the pathname, thank you very much." Otherwise, the temp one 'false' creates will stay forever, and fill the hard drive up.
{
_path = parentFolder.Combine(fileName);
string liftContents = string.Format("<?xml version='1.0' encoding='utf-8'?><lift version='{0}'>{1}</lift>", claimedLiftVersion, xmlOfEntries);
File.WriteAllText(_path, liftContents);
}
示例12: TestEnvironment
public TestEnvironment(string liftFileContent)
{
_folder = new TemporaryFolder("WritingSystemsInLiftFileHelper");
var pathtoLiftFile1 = Path.Combine(_folder.Path, "test1.lift");
_liftFile1 = new IO.TempFile(liftFileContent);
_liftFile1.MoveTo(pathtoLiftFile1);
Helper = new WritingSystemsInLiftFileHelper(WritingSystems, _liftFile1.Path);
}
示例13: 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));
}
示例14: RepoProjectName_SourceHasDotInName_IsNotLost
[Test]//regression
public void RepoProjectName_SourceHasDotInName_IsNotLost()
{
using (var f = new TemporaryFolder("SourceHasDotInName_IsNotLost.x.y"))
{
Synchronizer m = new Synchronizer(f.Path, new ProjectFolderConfiguration("blah"), new ConsoleProgress());
Assert.AreEqual("SourceHasDotInName_IsNotLost.x.y", m.RepoProjectName);
}
}
示例15: HasNoExtantRepositories
public void HasNoExtantRepositories()
{
using (var hasProject = new TemporaryFolder("hasRepo"))
{
var newFile = Path.Combine(hasProject.Path, "test.txt");
File.WriteAllText(newFile, "some stuff");
Assert.AreEqual(0, GetSharedProjectModel.ExtantRepoIdentifiers(hasProject.Path, null).Count);
}
}