Exemple #1
0
 void Download_None(QiniuFile qiniu)
 {
     try
     {
         qiniu.Download("");
     }
     catch (WebException e)
     {
         return;
     }
     Assert.Fail("No exception was thrown.");
 }
Exemple #2
0
        void Download_NotExists(QiniuFile qiniu)
        {
            string error_notExistsFile = "notExistsFile";

            try
            {
                qiniu.Download(error_notExistsFile);
            }
            catch (WebException e)
            {
                if (File.Exists(error_notExistsFile))
                    File.Delete(error_notExistsFile);
                return;
            }

            if (File.Exists(error_notExistsFile))
                File.Delete(error_notExistsFile);

            Assert.Fail("No exception was thrown.");
        }
Exemple #3
0
        void Download_bucketname_Error()
        {
            QiniuConfig conf = m_badbucketname_conf;
            QiniuFile qiniu = new QiniuFile(conf, "D:/");
            string file = "/test/";


            try
            {
                qiniu.init();
                qiniu.Download(file);
            }
            catch (WebException e)
            {
                if (File.Exists(file))
                    File.Delete(file);
                return;
            }

            if (File.Exists(file))
                File.Delete(file);

            Assert.Fail("No exception was thrown.");
        }
Exemple #4
0
        void Download_EmptyDirAndFilename_Error()
        {
            string empty_dir = "";
            string empty_filename = "";
            QiniuConfig conf = new QiniuConfig("Wege4i-gz1IyWpCEfjhfEjZDj9U7IAhCXwq5FzxP", "l9DlUgST1KhGInpA--QMqeY3sLmaQ6nBCp_HOpH9", "7xosys.com1.z0.glb.clouddn.com", "notebook");
            QiniuFile qiniu = new QiniuFile(conf, empty_dir);

            try
            {
                qiniu.init();
                qiniu.Download(empty_filename);
            }
            catch (ArgumentException e)
            {
                return;
            }
            Assert.Fail("No exception was thrown.");
        }
Exemple #5
0
        void Download_secretkey_Error()
        {
            QiniuConfig conf = m_badsecretkey_conf;
            QiniuFile qiniu = new QiniuFile(conf, ".");

            try
            {
                qiniu.init();
                qiniu.Download("/test/");
            }
            catch (WebException e)
            {
                return;
            }
            Assert.Fail("No exception was thrown.");
        }