Exemplo n.º 1
0
 public void IsChildOfMultipleParentsWithNullItemInList()
 {
     Assert.Throws <ArgumentNullException>(() =>
                                           File.IsSubDirectory(new List <string> {
         "d:\\", null
     }, "c:\\"));
 }
Exemplo n.º 2
0
 public void IsChildOfMultipleParents()
 {
     Assert.IsTrue(
         File.IsSubDirectory(new List <string>
     {
         "c:\\A\\",
         "c:\\A\\B\\C\\"
     }, "c:\\A\\B\\")
         );
 }
Exemplo n.º 3
0
 public void ChildCannotBeNull()
 {
     Assert.Throws <ArgumentNullException>(() =>
                                           File.IsSubDirectory(new List <string>
     {
         "D:\\A\\B\\",
         "c:\\A\\B\\C\\"
     },
                                                               null)
                                           );
 }
Exemplo n.º 4
0
 public void DifferentRootPathsLongRootPath(string parent, string path)
 {
     Assert.IsFalse(
         File.IsSubDirectory(parent, path)
         );
 }
Exemplo n.º 5
0
 [TestCase("c:/aa", "c://a")] //  same length... but not same
 public void ParentIsLongerThanChild(string parent, string path)
 {
     Assert.IsFalse(
         File.IsSubDirectory(parent, path)
         );
 }
Exemplo n.º 6
0
 [TestCase("c:/a/bbb/c.d", "c:/a/b.d/c.d")] // dot is wrong (first one)
 public void SameLenghButNotTheSame(string parent, string path)
 {
     Assert.IsFalse(
         File.IsSubDirectory(parent, path)
         );
 }
Exemplo n.º 7
0
 public void IsChildOfMultipleParentsWithEmptyList()
 {
     Assert.IsFalse(
         File.IsSubDirectory(new List <string>(), "c:\\")
         );
 }
Exemplo n.º 8
0
 public void CheckSpecialCases(string parent, string path)
 {
     Assert.IsTrue(
         File.IsSubDirectory(parent, path)
         );
 }
Exemplo n.º 9
0
 public void ChildStringCannotBeNull()
 {
     Assert.Throws <ArgumentNullException>(() => File.IsSubDirectory("c:\\", null));
 }
Exemplo n.º 10
0
 public void ChildDirectoryInfoCannotBeNull()
 {
     Assert.Throws <ArgumentNullException>(() => File.IsSubDirectory(new DirectoryInfo("c:\\"), null));
 }
Exemplo n.º 11
0
 public void ParentDirectoryInfoCannotBeNull()
 {
     Assert.Throws <ArgumentNullException>(() => File.IsSubDirectory((DirectoryInfo)null, new DirectoryInfo("c:\\")));
 }
Exemplo n.º 12
0
 public void ParentStringCannotBeNull()
 {
     Assert.Throws <ArgumentNullException>(() => File.IsSubDirectory((string)null, "c:\\"));
 }
Exemplo n.º 13
0
 public void CheckSpecialCasesNotChild(string parent, string path)
 {
     Assert.IsFalse(
         File.IsSubDirectory(parent, path)
         );
 }
Exemplo n.º 14
0
 public void CheckRootIsNotSame(string parent, string path)
 {
     Assert.IsFalse(
         File.IsSubDirectory(parent, path)
         );
 }
Exemplo n.º 15
0
 public void IsChildOfMultipleParentsWithNullList()
 {
     Assert.Throws <ArgumentNullException>(() =>
                                           File.IsSubDirectory((List <string>)(null), "c:\\")
                                           );
 }
Exemplo n.º 16
0
 public void CheckIsSubDirectorySameRootDirectory(string parent, string path)
 {
     Assert.IsTrue(
         File.IsSubDirectory(parent, path)
         );
 }
Exemplo n.º 17
0
 public void CheckIsChildOfParent(string parent, string path)
 {
     Assert.IsTrue(
         File.IsSubDirectory(parent, path)
         );
 }