public void CombineTest()
 {
     var p1 = "c:/1";
     var p2 = "a.txt";
     var p = new FileSystemProxy();
     var res = p.Combine(p1, p2);
     Assert.AreEqual(res, "c:/1\\a.txt");
 }
Exemplo n.º 2
0
        public void CombineTest()
        {
            var p1  = "c:/1";
            var p2  = "a.txt";
            var p   = new FileSystemProxy();
            var res = p.Combine(p1, p2);

            Assert.AreEqual(res, "c:/1\\a.txt");
        }
 public void FindFilesInSubDirTest()
 {
     var p = new FileSystemProxy();
     var dir = p.CreateTempEmptyFolder();
     CreateFiles(dir);
     var subdir = Path.Combine(dir, "1");
     Directory.CreateDirectory(subdir);
     CreateFiles(subdir+ "\\");
     var result = p.FindFiles(dir, "*.txt", true).ToList();
     Assert.AreEqual(result.Count, 4);
     var i1 = p.Combine(dir, "1.txt");
     var i2 = p.Combine(dir, "2.txt");
     var i3 = p.Combine(subdir, "1.txt");
     var i4 = p.Combine(subdir, "2.txt");
     Assert.IsTrue(result.Contains(i1));
     Assert.IsTrue(result.Contains(i2));
     Assert.IsTrue(result.Contains(i3));
     Assert.IsTrue(result.Contains(i4));
     Directory.Delete(dir, true);
 }
Exemplo n.º 4
0
        public void FindFilesNoSubDirTest()
        {
            var p   = new FileSystemProxy();
            var dir = p.CreateTempEmptyFolder();

            CreateFiles(dir);
            var subdir = Path.Combine(dir, "1");

            Directory.CreateDirectory(subdir);
            CreateFiles(subdir + "\\");
            var result = p.FindFiles(dir, "*.txt", false).ToList();

            Assert.AreEqual(result.Count, 2);
            var i1 = p.Combine(dir, "1.txt");
            var i2 = p.Combine(dir, "2.txt");

            Assert.IsTrue(result.Contains(i1));
            Assert.IsTrue(result.Contains(i2));
            Directory.Delete(dir, true);
        }