Пример #1
0
        public void TestDeleteFolder()
        {//DELETE /files/:path_or_filename
            Session session = BrickFtp.Login(domain, username, password);
            var     path    = "/Testtt/NewFolderTest";

            BrickFtp.DeleteFolder(session, path);
        }
Пример #2
0
        public void TestCreateFolder()
        {//POST /folders/:path_and_folder_name
            Session session = BrickFtp.Login(domain, username, password);
            var     path    = "/Testtt/NewFolderTest";

            BrickFtp.CreateFolder(session, path);
        }
Пример #3
0
        public void TestUploadFile()
        {   //POST /files/:path_and_filename
            string  file      = @"C:\temp\Forecast_MG_GwyntYMor_84_0_2016060400.csv";
            var     localFile = new FileInfo(file);
            Session session   = BrickFtp.Login(domain, username, password);

            BrickFtp.UploadFile(session, localFile, "/Testtt/NewFolderTest/Forecast_MG_GwyntYMor_84_0_2016060400.csv");
        }
Пример #4
0
        public void TestGetFile()
        {   //GET /files/:path_and_filename
            Session session  = BrickFtp.Login(domain, username, password);
            var     filePath = "/Testtt/Forecast_MG_GwyntYMor_21_0_2016060200.csv";

            FtpFileContent fileWithContent = BrickFtp.GetFile(session, filePath);

            Assert.IsTrue(fileWithContent.Content.Length > 0);
        }
Пример #5
0
        public void TestListFolder()
        {//GET /folders/
            Session        session = BrickFtp.Login(domain, username, password);
            string         path    = "/";
            List <FtpItem> folders = BrickFtp.ListFolder(session, path);

            foreach (var f in folders)
            {
                Console.Out.WriteLine("List: " + f.path);
            }
        }
Пример #6
0
        public void TestGetFolder()
        {
            Session session = BrickFtp.Login(domain, username, password);
            var     path    = "/Testtt";

            var items = BrickFtp.GetFolderStats(session, path);

            foreach (var item in items)
            {
                Console.Out.WriteLine("Type: " + item.type + " | Path: " + item.path);
            }
        }
Пример #7
0
        public void TestListFolderWithConstraints()
        {//GET /folders/
            //var operationPath = "/api/rest/v1/folders/test/Testtt?&per_page=1";
            //var operationPath = "/api/rest/v1/folders/test/Testtt?&sort_by[modified_at_datetime]=desc";
            //var operationPath = "/api/rest/v1/folders/test/Testtt?&search=201606030";
            Session        session       = BrickFtp.Login(domain, username, password);
            string         operationPath = "/Testtt";
            List <FtpItem> folders       = BrickFtp.ListFolderWithConstraints(session, operationPath, searchText: "201606030");

            foreach (var f in folders)
            {
                Console.Out.WriteLine("List: " + f.path);
            }
        }
Пример #8
0
        public void TestConnectToBrickFtp()
        {
            Session session = BrickFtp.Login(domain, username, password);

            Assert.IsNotNull(session);
        }
Пример #9
0
        public void TestCopyFolder()
        {   //POST /files/:source_path_and_filename
            Session session = BrickFtp.Login(domain, username, password);

            BrickFtp.CopyFileOrFolder(session, "/Testtt/YetAnotherTestFolder", "/Testtt/NewFolderTest/YetAnotherTestFolder");
        }
Пример #10
0
        public void TestCopyFile()
        {   //POST /files/:source_path_and_filename
            Session session = BrickFtp.Login(domain, username, password);

            BrickFtp.CopyFileOrFolder(session, "/Testtt/Forecast_MG_GwyntYMor_84_0_2016060400.csv", "/Testtt/NewFolderTest/Forecast_MG_GwyntYMor_84_0_2016060400.csv");
        }
Пример #11
0
        public void TestDeleteFile()
        {   //DELETE /files/:path_or_filename
            Session session = BrickFtp.Login(domain, username, password);

            BrickFtp.DeleteFile(session, "/Testtt/NewFolderTest/Forecast_MG_GwyntYMor_84_0_2016060400.csv");
        }