示例#1
0
        public void ChangeTypeTest()
        {
            Config config = new Config();

            config.Zone = Zone.ZONE_CN_East;
            Mac           mac           = new Mac(AccessKey, SecretKey);
            BucketManager bucketManager = new BucketManager(mac, config);
            HttpResult    ret           = bucketManager.ChangeType(Bucket, "qiniu.png", 1);

            if (ret.Code != (int)HttpCode.OK && !ret.Text.Contains("already in line stat"))
            {
                Assert.Fail("change type error: " + ret.ToString());
            }
            Console.WriteLine(ret.ToString());
        }
        public async Task ChangeTypeTest()
        {
            var config = new Config {
                Zone = Zone.ZoneCnEast
            };
            var mac           = new Mac(AccessKey, SecretKey);
            var bucketManager = new BucketManager(mac, config);
            var ret           = await bucketManager.ChangeType(Bucket, "qiniu.png", 1);

            if (ret.Code != (int)HttpCode.OK && !ret.Text.Contains("already in line stat"))
            {
                Assert.True(false, "change type error: " + ret);
            }

            Console.WriteLine(ret.ToString());
        }