Exemple #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
		}
Exemple #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"));
		}
Exemple #3
0
        public void ActualFilePath_DecomposedFilenameExists()
        {
            MockFileOS fileOs = new MockFileOS();

            fileOs.m_existingFiles.Add("\u0065\u0301");
            ReflectionHelper.SetField(typeof(FileUtils), "s_fileos", fileOs);
            Assert.AreEqual("\u0065\u0301", FileUtils.ActualFilePath("\u00e9"));             // accented e
        }
Exemple #4
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"));
        }
Exemple #5
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"));
        }
Exemple #6
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"));
        }
Exemple #7
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"));
		}
Exemple #8
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"));
		}