Example #1
0
 public void Setup()
 {
     SetUserCredential();
     IntrumFile.CreateFile(FILETestepath + FILETesteName);
     IntrumFile.CreateDirectory(FILETestepath2);
     IntrumFile.CreateDirectory(FILETestepath3);
 }
Example #2
0
        public void Should_CopyFile()
        {
            IntrumFile.DeleteFileIfExit(ZipfullPath);
            IntrumFile.CopyFileFromDirectoryTo(ZipfullPath3, ZipfullPath);

            var actual = 1;

            var getList = IntrumFile.GetFilesInDirectory(ZipPath1);

            Assert.AreEqual(actual, getList.Length);
        }
Example #3
0
        public void Should_DeleteFile_If_Exits()
        {
            IntrumFile.DeleteFileIfExit(ZipfullPath);
            IntrumFile.DeleteFileIfExit(ZipfullPath2);

            var actual = 0;

            var getList = IntrumFile.GetFilesInDirectory(ZipPath1);

            Assert.AreEqual(actual, getList.Length);
        }
Example #4
0
        public void Should_MoveFile()
        {
            IntrumFile.MoveFileFromDirectory(ZipfullPath3, ZipfullPath);

            var actual = 1;

            var getListTo   = IntrumFile.GetFilesInDirectory(ZipPath1);
            var getListFrom = IntrumFile.GetFilesInDirectory(ZipPath3);

            Assert.IsNotNull(getListTo);
            Assert.IsNotEmpty(getListTo);
            Assert.AreEqual(0, getListFrom.Length);
        }
Example #5
0
        public void Should_ListOnliZipeFile()
        {
            Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
            IntrumFile.DeleteFileIfExit(ZipfullPath);
            IntrumFile.CopyFileFromDirectoryTo(ZipfullPath3, ZipfullPath);



            var actual = IntrumFile.CreateDoubleZipFileContent(ZipPath1, ZipfullPath.Replace(".txt", ""), "123456");
            var sut    = IntrumFile.GetFilesInDirectory(ZipPath1, @"*.zip");

            Assert.AreEqual(1, sut.Length);
            Assert.Contains(actual, sut);
        }
Example #6
0
        public void Should_DeliteAllFiles()
        {
            Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
            IntrumFile.DeleteFileIfExit(ZipfullPath);
            IntrumFile.CopyFileFromDirectoryTo(ZipfullPath3, ZipfullPath);

            var actual = IntrumFile.CreateDoubleZipFileContent(ZipPath1, ZipfullPath.Replace(".txt", ""), "123456");
            var list   = IntrumFile.GetFilesInDirectory(ZipPath1, @"*.zip");

            foreach (var item in list)
            {
                IntrumFile.DeleteFileIfExit(item);
            }

            var sut = IntrumFile.GetFilesInDirectory(ZipPath1, @"*.zip");

            Assert.AreEqual(0, sut.Length);
            Assert.IsEmpty(sut);
        }
Example #7
0
        public void OnTestInitialize()
        {
            //CREATE BASE FOLDER
            var v1 = IntrumFile.CreateDirectory(FILETestepath + "1\\");
            var v2 = IntrumFile.CreateDirectory(FILETestepath + "2\\");
            var v3 = IntrumFile.CreateDirectory("c:\\TEMP\\" + "2\\");

            IntrumFile.CreateDirectory(FILETestepathzip);

            //CREATE BASE FILE
            IntrumFile.CreateFile(v1 + filename);
            IntrumFile.CreateFile(v2 + filename);
            IntrumFile.CreateFile(v3 + filename);

            ZipfullPath  = v1 + filename;
            ZipfullPath2 = v2 + filename;
            ZipfullPath3 = v3 + filename;

            ZipPath1 = v1;
            ZipPath2 = v2;
            ZipPath3 = v3;
        }
Example #8
0
        public void Should_MoveFileZipeToEnviadosEndCleanFolder()
        {
            Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
            IntrumFile.DeleteFileIfExit(ZipfullPath);
            IntrumFile.CopyFileFromDirectoryTo(ZipfullPath3, ZipfullPath);
            IntrumFile.MoveFileFromDirectory(ZipfullPath3, ZipfullPath);


            var actual = IntrumFile.CreateDoubleZipFileContent(ZipPath1, null, "123456");
            var name   = actual.Split('\\').Last();

            IntrumFile.MoveFileFromDirectory(actual, FILETestepathzip + name);
            IntrumFile.DeleteFileIfExit(ZipfullPath);

            var sut         = IntrumFile.GetFilesInDirectory(FILETestepathzip, @"*.zip");
            var acutualPath = IntrumFile.GetFilesInDirectory(ZipPath1);

            Assert.AreEqual(1, sut.Length);
            Assert.AreEqual(0, acutualPath.Length);
            Assert.IsEmpty(acutualPath);
            IntrumFile.DeleteFileIfExit(FILETestepathzip);
        }