Ejemplo n.º 1
0
 public void IsWithinFailsWhenOutsidePathUsingStringPath()
 {
     using (TestDirectory td = new TestDirectory("ParentDirectory", true))
     {
         DirectoryAssert.IsWithin(td.directoryName, Environment.SpecialFolder.System.ToString());
     }
 }
Ejemplo n.º 2
0
 public void IsWithinPassesWithStringPath()
 {
     using (TestDirectory td = new TestDirectory("ParentDirectory", true))
     {
         DirectoryAssert.IsWithin(td.directoryName, td.diSubSubDirectory.FullName);
     }
 }
Ejemplo n.º 3
0
 public void IsWithinPassesWithDirectoryInfo()
 {
     using (TestDirectory td = new TestDirectory("ParentDirectory", true))
     {
         DirectoryAssert.IsWithin(td.directoryInformation, td.diSubSubDirectory);
     }
 }
Ejemplo n.º 4
0
        public void IsWithinThrowsWhenBothAreNull()
        {
            DirectoryInfo expected = null;
            DirectoryInfo actual   = null;

            DirectoryAssert.IsWithin(expected, actual);
        }
Ejemplo n.º 5
0
 public void IsWithinFailsWhenOutsidePathUsingDirectoryInfo()
 {
     using (TestDirectory td = new TestDirectory("ParentDirectory", true))
     {
         DirectoryInfo diSystemFolder = new DirectoryInfo(Environment.SpecialFolder.System.ToString());
         DirectoryAssert.IsWithin(td.directoryInformation, diSystemFolder);
     }
 }
Ejemplo n.º 6
0
        public void IsWithinPassesWithTempPath()
        {
            // Special case because GetTempPath() returns with a trailing slash
            string tempPath       = Path.GetTempPath();
            string tempPathParent = Path.GetDirectoryName(Path.GetDirectoryName(tempPath));

            DirectoryAssert.IsWithin(tempPathParent, tempPath);
        }