Exemplo n.º 1
0
        public async Task Test_Invalidation()
        {
            //Sync Directory
            ICakeEnvironment env = CakeHelper.CreateEnvironment();

            DirectoryPath path = new DirectoryPath("./Files/").MakeAbsolute(env.WorkingDirectory);

            System.IO.File.WriteAllText(path.FullPath + "/Test.txt", Guid.NewGuid().ToString());



            SyncSettings settings = env.CreateSyncSettings();

            settings.BucketName = "cake-aws-s3";
            settings.KeyPrefix  = "cloudfront.tests/utils/";

            IS3Manager     s3   = CakeHelper.CreateS3Manager();
            IList <string> keys = await s3.SyncUpload(path, settings);

            keys.ShouldNotBeEmpty();



            //Invalidate Keys
            ICloudFrontManager cloud        = CakeHelper.CreateCloudFrontManager();
            string             invalidation = await cloud.CreateInvalidation("E212F1OAIR275D", keys, "", CakeHelper.CreateEnvironment().CreateCloudFrontSettings());

            invalidation.ShouldNotBeNullOrEmpty();
        }
Exemplo n.º 2
0
        public void Test_Syn()
        {
            //Sync Directory
            SyncSettings settings = CakeHelper.CreateEnvironment().CreateSyncSettings();

            settings.BucketName = "cake-aws-s3";
            settings.KeyPrefix  = "s3.tests";

            IS3Manager     manager = CakeHelper.CreateS3Manager();
            IList <string> keys    = manager.SyncUpload(new DirectoryPath("../../"), settings);

            Assert.NotEmpty(keys);
        }
Exemplo n.º 3
0
        public async Task Test_Syn()
        {
            //Sync Directory
            SyncSettings settings = CakeHelper.CreateEnvironment().CreateSyncSettings();

            settings.BucketName = "cake-aws-s3";
            settings.KeyPrefix  = "s3.tests";

            IS3Manager     manager = CakeHelper.CreateS3Manager();
            IList <string> keys    = await manager.SyncUpload(new DirectoryPath("./Files"), settings);

            keys.ShouldBeEmpty();
        }