Exemplo n.º 1
0
    public void CopyFile()
    {
        CopyFileSample  copyFileSample  = new CopyFileSample();
        ListFilesSample listFilesSample = new ListFilesSample();

        copyFileSample.CopyFile(_bucketFixture.BucketNameGeneric, _bucketFixture.FileName,
                                _bucketFixture.BucketNameRegional, _bucketFixture.CollectRegionalObject("CopyFile.txt"));
        var files = listFilesSample.ListFiles(_bucketFixture.BucketNameRegional);

        Assert.Contains(files, c => c.Name == "CopyFile.txt");
    }
    public void TestSetTemporaryHold()
    {
        SetTemporaryHoldSample     setTemporaryHoldSample     = new SetTemporaryHoldSample();
        ReleaseTemporaryHoldSample releaseTemporaryHoldSample = new ReleaseTemporaryHoldSample();
        UploadFileSample           uploadFileSample           = new UploadFileSample();
        GetMetadataSample          getMetadataSample          = new GetMetadataSample();

        uploadFileSample.UploadFile(_bucketFixture.BucketNameRegional, _bucketFixture.FilePath, _bucketFixture.CollectRegionalObject("SetTemporaryHold.txt"));

        setTemporaryHoldSample.SetTemporaryHold(_bucketFixture.BucketNameRegional, "SetTemporaryHold.txt");

        var metadata = getMetadataSample.GetMetadata(_bucketFixture.BucketNameRegional, "SetTemporaryHold.txt");

        Assert.True(metadata.TemporaryHold);

        releaseTemporaryHoldSample.ReleaseTemporaryHold(_bucketFixture.BucketNameRegional, "SetTemporaryHold.txt");
    }