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));
		}
Esempio n. 2
0
        public void GetTemporaryFile_CalledTwice_BothFilesFoundInSameTemporarySubdirectory()
        {
            TemporaryFolder temporaryFolder = new TemporaryFolder(TestContext.CurrentContext.Test.Name);

#pragma warning disable 618
            temporaryFolder.GetTemporaryFile();
            temporaryFolder.GetTemporaryFile();
#pragma warning restore 618
            Assert.AreEqual(2, Directory.GetFiles(temporaryFolder.Path).Length);
            temporaryFolder.Dispose();
            Assert.IsFalse(Directory.Exists(temporaryFolder.Path));
        }
			public TestEnvironment()
			{
				_temporaryFolder = new TemporaryFolder("LiftLexEntryRepositoryTests");
				string filePath = _temporaryFolder.GetTemporaryFile();
				_repository = new LiftLexEntryRepository(filePath);
				_headwordWritingSystem = new WritingSystemDefinition("th") {DefaultCollation = new IcuRulesCollationDefinition("standard")};
			}
		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));
		}
		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));
		}
Esempio n. 6
0
        public void GetTemporaryFile_FileExistsInTemporarySubdirectory()
        {
            TemporaryFolder temporaryFolder = new TemporaryFolder(TestContext.CurrentContext.Test.Name);

#pragma warning disable 618
            string pathToFile = temporaryFolder.GetTemporaryFile();
#pragma warning restore 618
            Assert.IsTrue(File.Exists(pathToFile));
            temporaryFolder.Dispose();
            Assert.IsFalse(Directory.Exists(temporaryFolder.Path));
        }