Ejemplo n.º 1
0
        public void Copy()
        {
            IDirectory Temp  = new ResourceDirectory("resource://FileCurator.Tests/");
            IDirectory Temp2 = new LocalDirectory("./Testing/");

            Temp2.Create();
            while (!Temp2.Exists)
            {
            }
            Temp = Temp.CopyTo(Temp2);
            Assert.True(Temp.Exists);
            Assert.True(Temp2.Exists);
            int Count = 0;

            foreach (var Files in Temp2.EnumerateFiles())
            {
                Assert.NotEqual(0, Files.Length);
                ++Count;
            }
            Assert.Equal(1, Count);
            Temp2.Delete();
            while (Temp2.Exists)
            {
            }
        }
Ejemplo n.º 2
0
        public void Move()
        {
            var Temp  = new WebDirectory("http://www.google.com", Client);
            var Temp2 = new LocalDirectory("./Testing/");

            Temp2.Create();
            while (!Temp2.Exists)
            {
            }
            Assert.Throws <HttpRequestException>(() => Temp.MoveTo(Temp2));
            Assert.True(Temp.Exists);
            Assert.True(Temp2.Exists);
            int Count = 0;

            foreach (var Files in Temp2.EnumerateFiles())
            {
                Assert.NotEqual(0, Files.Length);
                ++Count;
            }
            Assert.Equal(1, Count);
            Temp2.Delete();
        }
Ejemplo n.º 3
0
        public void Copy()
        {
            var Temp  = new WebDirectory("http://www.google.com", Client);
            var Temp2 = new LocalDirectory("./Testing/");

            Temp2.Create();
            while (!Temp2.Exists)
            {
            }
            Temp.CopyTo(Temp2);
            Assert.True(Temp.Exists);
            Assert.True(Temp2.Exists);
            int Count = 0;

            foreach (var Files in Temp2.EnumerateFiles())
            {
                Assert.NotEqual(0, Files.Length);
                ++Count;
            }
            Assert.Equal(1, Count);
            Temp2.Delete();
        }