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


C# TestUtilities.TemporaryFolder类代码示例

本文整理汇总了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));
		}
开发者ID:JohnThomson,项目名称:libpalaso,代码行数:7,代码来源:TemporaryFolderTests.cs

示例2: HgTestSetup

 public HgTestSetup()
 {
     _progress = new ConsoleProgress();
     Root = new TemporaryFolder("ChorusHgWrappingTest");
     HgRepository.CreateRepositoryInExistingDir(Root.Path,_progress);
     Repository = new HgRepository(Root.Path, new NullProgress());
 }
开发者ID:sillsdev,项目名称:chack,代码行数:7,代码来源:HgTestSetup.cs

示例3: Constructor_Path_CreatesTemporarySubDirectoryAtPath

		public void Constructor_Path_CreatesTemporarySubDirectoryAtPath()
		{
			using (TemporaryFolder temporaryFolder = new TemporaryFolder("foo"))
			{
				Assert.IsTrue(Directory.Exists(temporaryFolder.FolderPath));
			}
		}
开发者ID:JohnThomson,项目名称:libpalaso,代码行数:7,代码来源:TemporaryFolderTests.cs

示例4: Setup

		public void Setup()
		{
			_temporaryFolder = new TemporaryFolder();
			string filePath = _temporaryFolder.GetTemporaryFile();
			_repository = new LiftLexEntryRepository(filePath);
			_headwordWritingSystem = new WritingSystemDefinition("th");
		}
开发者ID:JohnThomson,项目名称:libpalaso,代码行数:7,代码来源:LexEntryRepositoryTests.cs

示例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));
		}
开发者ID:JohnThomson,项目名称:libpalaso,代码行数:7,代码来源:TemporaryFolderTests.cs

示例6: Setup

		public void Setup()
		{
			ErrorReport.IsOkToInteractWithUser = false;
			_tmpFolder = new TemporaryFolder("IMDIArchiveHelperTestFolder");
			_model = new IMDIArchivingDlgViewModel(kAppName, kTitle, kArchiveId, null, true,
				SetFilesToArchive, _tmpFolder.Path);
		}
开发者ID:JohnThomson,项目名称:libpalaso,代码行数:7,代码来源:IMDIArchivingDlgViewModelTests.cs

示例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);
 }
开发者ID:sillsdev,项目名称:chack,代码行数:7,代码来源:RepositorySetup.cs

示例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);
			}
		}
开发者ID:JohnThomson,项目名称:libpalaso,代码行数:8,代码来源:GlobalWritingSystemRepositoryTests.cs

示例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"));
			}
		}
开发者ID:JohnThomson,项目名称:libpalaso,代码行数:8,代码来源:GlobalWritingSystemRepositoryTests.cs

示例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[]{}));
     }
 }
开发者ID:JessieGriffin,项目名称:chorus,代码行数:8,代码来源:ChorusApplicationTests.cs

示例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);
		}
开发者ID:JohnThomson,项目名称:libpalaso,代码行数:8,代码来源:TemporaryFolder.cs

示例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);
			}
开发者ID:JohnThomson,项目名称:libpalaso,代码行数:8,代码来源:WritingSystemsInLiftFileHelperTests.cs

示例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));
		}
开发者ID:JohnThomson,项目名称:libpalaso,代码行数:8,代码来源:TemporaryFolderTests.cs

示例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);
            }
        }
开发者ID:sillsdev,项目名称:chack,代码行数:10,代码来源:Synchronizer.BadSituationTests.cs

示例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);
     }
 }
开发者ID:sillsdev,项目名称:chack,代码行数:9,代码来源:GetSharedProjectModelTests.cs


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