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
0
        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));
        }
		public void Setup()
		{
			_temporaryFolder = new TemporaryFolder();
			string filePath = _temporaryFolder.GetTemporaryFile();
			_repository = new LiftLexEntryRepository(filePath);
			_headwordWritingSystem = new WritingSystemDefinition("th");
		}
		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));
		}
示例#6
0
        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));
        }
示例#7
0
        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));
        }
		public void Setup()
		{
			_tempfolder = new TemporaryFolder();
			string persistedFilePath = _tempfolder.GetTemporaryFile();
			_repository = new LiftLexEntryRepository(persistedFilePath);
		}