Пример #1
0
    public void TestAddFileOwner()
    {
        AddFileOwnerSample    addFileOwnerSample    = new AddFileOwnerSample();
        RemoveFileOwnerSample removeFileOwnerSample = new RemoveFileOwnerSample();

        // Add file owner.
        var result = addFileOwnerSample.AddFileOwner(_fixture.BucketNameGeneric, _fixture.FileName, _fixture.ServiceAccountEmail);

        Assert.Contains(result.Acl, c => c.Role == "OWNER" && c.Email == _fixture.ServiceAccountEmail);

        // Remove file owner.
        removeFileOwnerSample.RemoveFileOwner(_fixture.BucketNameGeneric, _fixture.FileName, _fixture.ServiceAccountEmail);
    }
Пример #2
0
    public void TestRemoveFileOwner()
    {
        AddFileOwnerSample    addFileOwnerSample    = new AddFileOwnerSample();
        RemoveFileOwnerSample removeFileOwnerSample = new RemoveFileOwnerSample();
        GetMetadataSample     getMetadataSample     = new GetMetadataSample();

        // Add file owner.
        addFileOwnerSample.AddFileOwner(_bucketFixture.BucketNameGeneric, _bucketFixture.FileName, _bucketFixture.ServiceAccountEmail);

        // Remove file owner.
        removeFileOwnerSample.RemoveFileOwner(_bucketFixture.BucketNameGeneric, _bucketFixture.FileName, _bucketFixture.ServiceAccountEmail);

        var metadata = getMetadataSample.GetMetadata(_bucketFixture.BucketNameGeneric, _bucketFixture.FileName);

        Assert.DoesNotContain(metadata.Acl, acl => acl.Email == _bucketFixture.ServiceAccountEmail && acl.Role == "OWNER");
    }