示例#1
0
		public void ActualFilePath_ComposedFilenameExists()
		{
			MockFileOS fileOs = new MockFileOS();
			fileOs.m_existingFiles.Add("\u00e9");
			ReflectionHelper.SetField(typeof(FileUtils), "s_fileos", fileOs);
			Assert.AreEqual("\u00e9", FileUtils.ActualFilePath("\u0065\u0301")); // accented e
		}
示例#2
0
		public void ActualFilePath_FileDoesNotExist()
		{
			MockFileOS fileOs = new MockFileOS();
			fileOs.m_existingFiles.Add("flurp");
			ReflectionHelper.SetField(typeof(FileUtils), "s_fileos", fileOs);
			Assert.AreEqual("boo", FileUtils.ActualFilePath("boo"));
		}
示例#3
0
		public void ActualFilePath_DirectoryNameDecomposedFilenameExistsWithDifferentCase()
		{
			MockFileOS fileOs = new MockFileOS();
			fileOs.m_existingFiles.Add("AbC");
			fileOs.m_existingDirectories.Add("c:\\My Docum\u0065\u0301nts");
			ReflectionHelper.SetField(typeof(FileUtils), "s_fileos", fileOs);
			Assert.AreEqual("c:\\My Docum\u0065\u0301nts\\AbC", FileUtils.ActualFilePath("c:\\My Docum\u00e9nts\\abc"));
		}
示例#4
0
		public void ActualFilePath_DirectoryNameExactMatchFilenameExistsWithDifferentCase()
		{
			MockFileOS fileOs = new MockFileOS();
			fileOs.m_existingFiles.Add("AbC");
			fileOs.m_existingDirectories.Add(@"c:\My Documents");
			ReflectionHelper.SetField(typeof(FileUtils), "s_fileos", fileOs);
			Assert.AreEqual(@"c:\My Documents\AbC", FileUtils.ActualFilePath(@"c:\My Documents\abc"));
		}