Beispiel #1
0
    public void TestRemoveBucketConditionalIamBinding()
    {
        AddBucketConditionalIamBindingSample    addBucketConditionalIamBindingSample    = new AddBucketConditionalIamBindingSample();
        RemoveBucketConditionalIamBindingSample removeBucketConditionalIamBindingSample = new RemoveBucketConditionalIamBindingSample();
        ViewBucketIamMembersSample            viewBucketIamMembersSample            = new ViewBucketIamMembersSample();
        EnableUniformBucketLevelAccessSample  enableUniformBucketLevelAccessSample  = new EnableUniformBucketLevelAccessSample();
        DisableUniformBucketLevelAccessSample disableUniformBucketLevelAccessSample = new DisableUniformBucketLevelAccessSample();
        string memberType = "serviceAccount";
        string role       = "roles/storage.objectViewer";

        // Enable Uniform bucket level access.
        enableUniformBucketLevelAccessSample.EnableUniformBucketLevelAccess(_bucketFixture.BucketNameGeneric);
        _bucketFixture.SleepAfterBucketCreateUpdateDelete();

        // Add Conditional Binding.
        addBucketConditionalIamBindingSample.AddBucketConditionalIamBinding(_bucketFixture.BucketNameGeneric,
                                                                            role, $"{memberType}:{_bucketFixture.ServiceAccountEmail}", "title", "description",
                                                                            "resource.name.startsWith(\"projects/_/buckets/bucket-name/objects/prefix-a-\")");
        _bucketFixture.SleepAfterBucketCreateUpdateDelete();

        // Remove Conditional Binding.
        removeBucketConditionalIamBindingSample.RemoveBucketConditionalIamBinding(_bucketFixture.BucketNameGeneric,
                                                                                  role, "title", "description",
                                                                                  "resource.name.startsWith(\"projects/_/buckets/bucket-name/objects/prefix-a-\")");
        _bucketFixture.SleepAfterBucketCreateUpdateDelete();

        // Get Bucket Iam Members.
        var policy = viewBucketIamMembersSample.ViewBucketIamMembers(_bucketFixture.BucketNameGeneric);

        Assert.DoesNotContain(policy.Bindings, c => c.Members.Contains($"{memberType}:{_bucketFixture.ServiceAccountEmail}"));

        // Disable Uniform bucket level access
        disableUniformBucketLevelAccessSample.DisableUniformBucketLevelAccess(_bucketFixture.BucketNameGeneric);
        _bucketFixture.SleepAfterBucketCreateUpdateDelete();
    }
    public void TestEnableBucketDefaultEventBasedHold()
    {
        EnableBucketDefaultEventBasedHoldSample enableBucketDefaultEventBasedHoldSample = new EnableBucketDefaultEventBasedHoldSample();
        DisableDefaultEventBasedHoldSample      disableDefaultEventBasedHoldSample      = new DisableDefaultEventBasedHoldSample();

        // Enable default event based hold.
        var updatedBucket = enableBucketDefaultEventBasedHoldSample.EnableBucketDefaultEventBasedHold(_bucketFixture.BucketNameGeneric);

        _bucketFixture.SleepAfterBucketCreateUpdateDelete();
        Assert.True(updatedBucket.DefaultEventBasedHold);

        // Disable default event based hold.
        disableDefaultEventBasedHoldSample.DisableDefaultEventBasedHold(_bucketFixture.BucketNameGeneric);
        _bucketFixture.SleepAfterBucketCreateUpdateDelete();
    }
    public void TestAddBucketOwner()
    {
        AddBucketOwnerSample    addBucketOwnerSample    = new AddBucketOwnerSample();
        RemoveBucketOwnerSample removeBucketOwnerSample = new RemoveBucketOwnerSample();

        // Add bucket owner.
        var result = addBucketOwnerSample.AddBucketOwner(_bucketFixture.BucketNameGeneric, _bucketFixture.ServiceAccountEmail);

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

        // Remove bucket owner.
        removeBucketOwnerSample.RemoveBucketOwner(_bucketFixture.BucketNameGeneric, _bucketFixture.ServiceAccountEmail);
        _bucketFixture.SleepAfterBucketCreateUpdateDelete();
    }
Beispiel #4
0
    public void TestAddBucketDefaultOwner()
    {
        AddBucketDefaultOwnerSample    addBucketDefaultOwnerSample    = new AddBucketDefaultOwnerSample();
        RemoveBucketDefaultOwnerSample removeBucketDefaultOwnerSample = new RemoveBucketDefaultOwnerSample();

        // Add bucket default owner.
        var updatedBucket = addBucketDefaultOwnerSample.AddBucketDefaultOwner(_bucketFixture.BucketNameGeneric, _bucketFixture.ServiceAccountEmail);

        Assert.Contains(updatedBucket.DefaultObjectAcl, acl => acl.Role == "OWNER" && acl.Email == _bucketFixture.ServiceAccountEmail);
        _bucketFixture.SleepAfterBucketCreateUpdateDelete();

        // Remove bucket default owner.
        removeBucketDefaultOwnerSample.RemoveBucketDefaultOwner(_bucketFixture.BucketNameGeneric, _bucketFixture.ServiceAccountEmail);
        _bucketFixture.SleepAfterBucketCreateUpdateDelete();
    }
Beispiel #5
0
    public void TestEnableBucketLifecycleManagement()
    {
        var enableBucketLifecycleManagementSample  = new EnableBucketLifecycleManagementSample();
        var disableBucketLifecycleManagementSample = new DisableBucketLifecycleManagementSample();

        // Enable bucket lifecycle management.
        var bucket = enableBucketLifecycleManagementSample.EnableBucketLifecycleManagement(_bucketFixture.BucketNameGeneric);

        _bucketFixture.SleepAfterBucketCreateUpdateDelete();
        Assert.Contains(bucket.Lifecycle.Rule, r => r.Condition.Age == 100 && r.Action.Type == "Delete");

        // Disable bucket lifecycle management.
        disableBucketLifecycleManagementSample.DisableBucketLifecycleManagement(_bucketFixture.BucketNameGeneric);
        _bucketFixture.SleepAfterBucketCreateUpdateDelete();
    }
Beispiel #6
0
    public void TestDisableBucketLifecycleManagement()
    {
        EnableBucketLifecycleManagementSample  enableBucketLifecycleManagementSample  = new EnableBucketLifecycleManagementSample();
        DisableBucketLifecycleManagementSample disableBucketLifecycleManagementSample = new DisableBucketLifecycleManagementSample();

        // Enable bucket lifecycle management.
        enableBucketLifecycleManagementSample.EnableBucketLifecycleManagement(_bucketFixture.BucketNameGeneric);
        _bucketFixture.SleepAfterBucketCreateUpdateDelete();

        // Disable bucket lifecycle management.
        var bucket = disableBucketLifecycleManagementSample.DisableBucketLifecycleManagement(_bucketFixture.BucketNameGeneric);

        _bucketFixture.SleepAfterBucketCreateUpdateDelete();
        Assert.Null(bucket.Lifecycle);
    }
Beispiel #7
0
    public void TestSetRetentionPolicy()
    {
        SetRetentionPolicySample    setRetentionPolicySample    = new SetRetentionPolicySample();
        RemoveRetentionPolicySample removeRetentionPolicySample = new RemoveRetentionPolicySample();
        var retentionPeriod = 5;

        // Set retention policy.
        var retentionPolicy = setRetentionPolicySample.SetRetentionPolicy(_bucketFixture.BucketNameGeneric, retentionPeriod);

        _bucketFixture.SleepAfterBucketCreateUpdateDelete();
        Assert.Equal(retentionPolicy.RetentionPeriod, retentionPeriod);

        // Remove retention policy.
        removeRetentionPolicySample.RemoveRetentionPolicy(_bucketFixture.BucketNameGeneric);
        _bucketFixture.SleepAfterBucketCreateUpdateDelete();
    }
    public void TestAddBucketIamMember()
    {
        string role       = "roles/storage.objectViewer";
        string memberType = "serviceAccount";
        AddBucketIamMemberSample    addBucketIamMemberSample    = new AddBucketIamMemberSample();
        RemoveBucketIamMemberSample removeBucketIamMemberSample = new RemoveBucketIamMemberSample();

        // Add bucket Iam member.
        var result = addBucketIamMemberSample.AddBucketIamMember(_bucketFixture.BucketNameGeneric, role, $"{memberType}:{_bucketFixture.ServiceAccountEmail}");

        _bucketFixture.SleepAfterBucketCreateUpdateDelete();
        Assert.Contains(result.Bindings, b => b.Role == role && b.Members.Contains($"{memberType}:{_bucketFixture.ServiceAccountEmail}"));

        // Remove bucket Iam member.
        removeBucketIamMemberSample.RemoveBucketIamMember(_bucketFixture.BucketNameGeneric, role, $"{memberType}:{_bucketFixture.ServiceAccountEmail}");
        _bucketFixture.SleepAfterBucketCreateUpdateDelete();
    }
    public void DeleteBucket()
    {
        DeleteBucketSample      deleteBucketSample      = new DeleteBucketSample();
        CreateBucketSample      createBucketSample      = new CreateBucketSample();
        GetBucketMetadataSample getBucketMetadataSample = new GetBucketMetadataSample();
        var bucketName = Guid.NewGuid().ToString();

        createBucketSample.CreateBucket(_bucketFixture.ProjectId, bucketName);
        _bucketFixture.SleepAfterBucketCreateUpdateDelete();

        deleteBucketSample.DeleteBucket(bucketName);
        _bucketFixture.SleepAfterBucketCreateUpdateDelete();

        var exception = Assert.Throws <GoogleApiException>(() => getBucketMetadataSample.GetBucketMetadata(bucketName));

        Assert.Equal(System.Net.HttpStatusCode.NotFound, exception.HttpStatusCode);
    }
    public void TestRemoveRetentionPolicy()
    {
        GetRetentionPolicySample    getRetentionPolicySample    = new GetRetentionPolicySample();
        SetRetentionPolicySample    setRetentionPolicySample    = new SetRetentionPolicySample();
        RemoveRetentionPolicySample removeRetentionPolicySample = new RemoveRetentionPolicySample();
        var retentionPeriod = 5;

        // Set retention policy.
        setRetentionPolicySample.SetRetentionPolicy(_bucketFixture.BucketNameGeneric, retentionPeriod);
        _bucketFixture.SleepAfterBucketCreateUpdateDelete();

        // Remove retention policy.
        removeRetentionPolicySample.RemoveRetentionPolicy(_bucketFixture.BucketNameGeneric);
        _bucketFixture.SleepAfterBucketCreateUpdateDelete();
        var result = getRetentionPolicySample.GetRetentionPolicy(_bucketFixture.BucketNameGeneric);

        Assert.Null(result);
    }
Beispiel #11
0
    public void EnableDefaultKMSKey()
    {
        EnableDefaultKMSKeySample enableDefaultKMSKeySample = new EnableDefaultKMSKeySample();
        var bucket = enableDefaultKMSKeySample.EnableDefaultKMSKey(_bucketFixture.ProjectId, _bucketFixture.BucketNameRegional,
                                                                   _bucketFixture.KmsKeyLocation, _bucketFixture.KmsKeyRing, _bucketFixture.KmsKeyName);

        _bucketFixture.SleepAfterBucketCreateUpdateDelete();
        Assert.NotNull(bucket.Encryption.DefaultKmsKeyName);
    }
    public void TestEnableRequesterPays()
    {
        EnableRequesterPaysSample  enableRequesterPaysSample  = new EnableRequesterPaysSample();
        DisableRequesterPaysSample disableRequesterPaysSample = new DisableRequesterPaysSample();
        var bucketName = Guid.NewGuid().ToString();

        // Create bucket
        _bucketFixture.CreateBucket(bucketName);

        // Enable request pay.
        var bucket = enableRequesterPaysSample.EnableRequesterPays(bucketName);

        _bucketFixture.SleepAfterBucketCreateUpdateDelete();
        Assert.True(bucket.Billing?.RequesterPays);

        // Disable request pay.
        disableRequesterPaysSample.DisableRequesterPays(_bucketFixture.ProjectId, bucketName);
        _bucketFixture.SleepAfterBucketCreateUpdateDelete();
    }
    public void TestGetRequesterPaysStatus()
    {
        GetRequesterPaysStatusSample getRequesterPaysStatusSample = new GetRequesterPaysStatusSample();
        EnableRequesterPaysSample    enableRequesterPaysSample    = new EnableRequesterPaysSample();
        DisableRequesterPaysSample   disableRequesterPaysSample   = new DisableRequesterPaysSample();

        // Enable request pay.
        enableRequesterPaysSample.EnableRequesterPays(_bucketFixture.BucketNameGeneric);
        _bucketFixture.SleepAfterBucketCreateUpdateDelete();

        // Get status.
        var status = getRequesterPaysStatusSample.GetRequesterPaysStatus(_bucketFixture.ProjectId, _bucketFixture.BucketNameGeneric);

        Assert.True(status);

        // Disable request pay.
        disableRequesterPaysSample.DisableRequesterPays(_bucketFixture.ProjectId, _bucketFixture.BucketNameGeneric);
        _bucketFixture.SleepAfterBucketCreateUpdateDelete();
    }
    public void TestRemoveBucketOwner()
    {
        AddBucketOwnerSample    addBucketOwnerSample    = new AddBucketOwnerSample();
        RemoveBucketOwnerSample removeBucketOwnerSample = new RemoveBucketOwnerSample();
        GetBucketMetadataSample getBucketMetadataSample = new GetBucketMetadataSample();

        // Add bucket owner.
        addBucketOwnerSample.AddBucketOwner(_bucketFixture.BucketNameGeneric, _bucketFixture.ServiceAccountEmail);
        _bucketFixture.SleepAfterBucketCreateUpdateDelete();

        // Remove bucket owner.
        removeBucketOwnerSample.RemoveBucketOwner(_bucketFixture.BucketNameGeneric, _bucketFixture.ServiceAccountEmail);
        _bucketFixture.SleepAfterBucketCreateUpdateDelete();

        // Get bucket metadata.
        var bucketMetadata = getBucketMetadataSample.GetBucketMetadata(_bucketFixture.BucketNameGeneric);

        Assert.DoesNotContain(bucketMetadata.Acl, acl => acl.Role == "OWNER" && acl.Email == _bucketFixture.ServiceAccountEmail);
    }
    public void TestPrintBucketAclForUser()
    {
        PrintBucketAclForUserSample printBucketAclForUserSample = new PrintBucketAclForUserSample();
        AddBucketOwnerSample        addBucketOwnerSample        = new AddBucketOwnerSample();
        RemoveBucketOwnerSample     removeBucketOwnerSample     = new RemoveBucketOwnerSample();
        string userEmail = _bucketFixture.ServiceAccountEmail;

        // Add bucket owner
        addBucketOwnerSample.AddBucketOwner(_bucketFixture.BucketNameGeneric, userEmail);
        _bucketFixture.SleepAfterBucketCreateUpdateDelete();

        var bucketAclForUser = printBucketAclForUserSample.PrintBucketAclForUser(_bucketFixture.BucketNameGeneric, userEmail);

        Assert.All(bucketAclForUser, c => Assert.Equal(c.Email, userEmail));

        // Remove bucket owner
        removeBucketOwnerSample.RemoveBucketOwner(_bucketFixture.BucketNameGeneric, userEmail);
        _bucketFixture.SleepAfterBucketCreateUpdateDelete();
    }
    public void TestPrintBucketDefaultAcl()
    {
        PrintBucketDefaultAclSample    printBucketDefaultAclSample    = new PrintBucketDefaultAclSample();
        AddBucketDefaultOwnerSample    addBucketDefaultOwnerSample    = new AddBucketDefaultOwnerSample();
        RemoveBucketDefaultOwnerSample removeBucketDefaultOwnerSample = new RemoveBucketDefaultOwnerSample();
        string userEmail = _bucketFixture.ServiceAccountEmail;

        // add default owner
        addBucketDefaultOwnerSample.AddBucketDefaultOwner(_bucketFixture.BucketNameGeneric, userEmail);
        _bucketFixture.SleepAfterBucketCreateUpdateDelete();

        // print default owner
        var defaultBucketAcl = printBucketDefaultAclSample.PrintBucketDefaultAcl(_bucketFixture.BucketNameGeneric);

        Assert.Contains(defaultBucketAcl, c => c.Role == "OWNER" && c.Email == userEmail);

        // remove default owner
        removeBucketDefaultOwnerSample.RemoveBucketDefaultOwner(_bucketFixture.BucketNameGeneric, userEmail);
        _bucketFixture.SleepAfterBucketCreateUpdateDelete();
    }
Beispiel #17
0
    public void TestViewBucketIamMembers()
    {
        string role       = "roles/storage.objectViewer";
        string memberType = "serviceAccount";
        var    addBucketIamMemberSample = new AddBucketIamMemberSample();
        RemoveBucketIamMemberSample removeBucketIamMemberSample = new RemoveBucketIamMemberSample();
        ViewBucketIamMembersSample  viewBucketIamMembersSample  = new ViewBucketIamMembersSample();

        // Add bucket Iam members.
        addBucketIamMemberSample.AddBucketIamMember(_bucketFixture.BucketNameGeneric, role, $"{memberType}:{_bucketFixture.ServiceAccountEmail}");
        _bucketFixture.SleepAfterBucketCreateUpdateDelete();

        // Get bucket Iam members.
        var result = viewBucketIamMembersSample.ViewBucketIamMembers(_bucketFixture.BucketNameGeneric);

        Assert.Contains(result.Bindings.Where(b => b.Role == role).SelectMany(b => b.Members), m => m == $"{memberType}:{_bucketFixture.ServiceAccountEmail}");

        // Remove bucket Iam members.
        removeBucketIamMemberSample.RemoveBucketIamMember(_bucketFixture.BucketNameGeneric, role, $"{memberType}:{_bucketFixture.ServiceAccountEmail}");
        _bucketFixture.SleepAfterBucketCreateUpdateDelete();
    }
    public void TestDisableUniformBucketLevelAccess()
    {
        EnableUniformBucketLevelAccessSample  enableUniformBucketLevelAccessSample  = new EnableUniformBucketLevelAccessSample();
        DisableUniformBucketLevelAccessSample disableUniformBucketLevelAccessSample = new DisableUniformBucketLevelAccessSample();

        var bucketName = Guid.NewGuid().ToString();

        // Create bucket
        _bucketFixture.CreateBucket(bucketName);

        // Enable Uniform bucket level access.
        enableUniformBucketLevelAccessSample.EnableUniformBucketLevelAccess(bucketName);
        _bucketFixture.SleepAfterBucketCreateUpdateDelete();

        // Disable Uniform bucket level access.
        var updatedBucket = disableUniformBucketLevelAccessSample.DisableUniformBucketLevelAccess(bucketName);

        _bucketFixture.SleepAfterBucketCreateUpdateDelete();

        Assert.False(updatedBucket.IamConfiguration.UniformBucketLevelAccess.Enabled);
    }
    public void CreateRegionalBucket()
    {
        CreateRegionalBucketSample createRegionalBucketSample = new CreateRegionalBucketSample();
        var bucketName = Guid.NewGuid().ToString();
        var buket      = createRegionalBucketSample.CreateRegionalBucket(
            _bucketFixture.ProjectId, bucketName, _bucketFixture.TestLocation, StorageClasses.Regional);

        _bucketFixture.SleepAfterBucketCreateUpdateDelete();
        _bucketFixture.TempBucketNames.Add(bucketName);

        Assert.Equal(buket.Location.ToLower(), _bucketFixture.KmsKeyLocation.ToLower());
        Assert.Equal("regional", buket.StorageClass.ToLower());
    }
    public void CreateBucket()
    {
        CreateBucketSample      createBucketSample      = new CreateBucketSample();
        GetBucketMetadataSample getBucketMetadataSample = new GetBucketMetadataSample();
        var bucketName = Guid.NewGuid().ToString();

        createBucketSample.CreateBucket(_bucketFixture.ProjectId, bucketName);
        _bucketFixture.SleepAfterBucketCreateUpdateDelete();
        _bucketFixture.TempBucketNames.Add(bucketName);

        var metadata = getBucketMetadataSample.GetBucketMetadata(bucketName);

        Assert.NotNull(metadata);
    }
Beispiel #21
0
    public void TestAddBucketConditionalIamBinding()
    {
        AddBucketConditionalIamBindingSample addBucketConditionalIamBindingSample = new AddBucketConditionalIamBindingSample();
        EnableUniformBucketLevelAccessSample enableUniformBucketLevelAccessSample = new EnableUniformBucketLevelAccessSample();
        var    bucketName = Guid.NewGuid().ToString();
        string memberType = "serviceAccount";
        string role       = "roles/storage.objectViewer";

        // Create bucket
        _bucketFixture.CreateBucket(bucketName);

        // Enable Uniform bucket level access.
        enableUniformBucketLevelAccessSample.EnableUniformBucketLevelAccess(bucketName);
        _bucketFixture.SleepAfterBucketCreateUpdateDelete();

        // Add Conditional Binding.
        var policy = addBucketConditionalIamBindingSample.AddBucketConditionalIamBinding(bucketName,
                                                                                         role, $"{memberType}:{_bucketFixture.ServiceAccountEmail}", "title", "description",
                                                                                         "resource.name.startsWith(\"projects/_/buckets/bucket-name/objects/prefix-a-\")");

        _bucketFixture.SleepAfterBucketCreateUpdateDelete();

        Assert.Contains(policy.Bindings, c => c.Members.Contains($"{memberType}:{_bucketFixture.ServiceAccountEmail}"));
    }
Beispiel #22
0
    public void TestPrintBucketAcl()
    {
        PrintBucketAclSample    printBucketAclSample    = new PrintBucketAclSample();
        AddBucketOwnerSample    addBucketOwnerSample    = new AddBucketOwnerSample();
        RemoveBucketOwnerSample removeBucketOwnerSample = new RemoveBucketOwnerSample();
        string userEmail = _bucketFixture.ServiceAccountEmail;

        // print bucket acl
        var bucketAcl = printBucketAclSample.PrintBucketAcl(_bucketFixture.BucketNameGeneric);

        Assert.DoesNotContain(bucketAcl, c => c.Email == userEmail);

        // add bucket owner
        addBucketOwnerSample.AddBucketOwner(_bucketFixture.BucketNameGeneric, userEmail);
        _bucketFixture.SleepAfterBucketCreateUpdateDelete();

        // print bucket acl
        bucketAcl = printBucketAclSample.PrintBucketAcl(_bucketFixture.BucketNameGeneric);
        Assert.Contains(bucketAcl, c => c.Email == userEmail);

        // remove owner.
        removeBucketOwnerSample.RemoveBucketOwner(_bucketFixture.BucketNameGeneric, userEmail);
        _bucketFixture.SleepAfterBucketCreateUpdateDelete();
    }
Beispiel #23
0
    public void TestSetPublicAccessPreventionUnspecified()
    {
        SetPublicAccessPreventionUnspecifiedSample setPublicAccessPreventionUnspecifiedSample = new SetPublicAccessPreventionUnspecifiedSample();

        var bucketName = Guid.NewGuid().ToString();

        // Create bucket
        _bucketFixture.CreateBucket(bucketName);

        // Set public access prevention to unspecified.
        var updatedBucket = setPublicAccessPreventionUnspecifiedSample.SetPublicAccessPreventionUnspecified(bucketName);

        _bucketFixture.SleepAfterBucketCreateUpdateDelete();

        Assert.Equal("unspecified", updatedBucket.IamConfiguration.PublicAccessPrevention);
    }
Beispiel #24
0
    public void TestGetUniformBucketLevelAccess()
    {
        EnableUniformBucketLevelAccessSample enableUniformBucketLevelAccessSample = new EnableUniformBucketLevelAccessSample();
        GetUniformBucketLevelAccessSample    getUniformBucketLevelAccessSample    = new GetUniformBucketLevelAccessSample();

        var bucketName = Guid.NewGuid().ToString();

        // Create bucket
        _bucketFixture.CreateBucket(bucketName);

        // Enable Uniform bucket level access.
        enableUniformBucketLevelAccessSample.EnableUniformBucketLevelAccess(bucketName);
        _bucketFixture.SleepAfterBucketCreateUpdateDelete();

        var uniformBucketLevelAccess = getUniformBucketLevelAccessSample.GetUniformBucketLevelAccess(bucketName);

        Assert.True(uniformBucketLevelAccess.Enabled);
    }
Beispiel #25
0
    public void TestGetPublicAccessPrevention()
    {
        GetPublicAccessPreventionSample getPublicAccessPreventionSample = new GetPublicAccessPreventionSample();

        var bucketName = Guid.NewGuid().ToString();

        // Create bucket
        _bucketFixture.CreateBucket(bucketName);

        // Set public access prevention to enforced.
        SetPublicAccessPreventionEnforcedSample setPublicAccessPreventionEnforcedSample = new SetPublicAccessPreventionEnforcedSample();

        setPublicAccessPreventionEnforcedSample.SetPublicAccessPreventionEnforced(bucketName);
        _bucketFixture.SleepAfterBucketCreateUpdateDelete();

        var publicAccessPrevention = getPublicAccessPreventionSample.GetPublicAccessPrevention(bucketName);

        Assert.Equal("enforced", publicAccessPrevention);
    }