-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add support for modifiable retention policies & enable deleting…
… retention policy assignment (#856)
- Loading branch information
1 parent
5ef2f18
commit 564904f
Showing
8 changed files
with
156 additions
and
15 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
Box.V2.Test.Integration/BoxRetentionPolicyManagerIntegrationTest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using System; | ||
using System.Threading.Tasks; | ||
using Box.V2.Exceptions; | ||
using Box.V2.Models; | ||
using Box.V2.Models.Request; | ||
using Box.V2.Test.Integration.Configuration; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
|
||
namespace Box.V2.Test.Integration | ||
{ | ||
[TestClass] | ||
public class BoxRetentionPolicyManagerIntegrationTest : TestInFolder | ||
{ | ||
[TestMethod] | ||
public async Task CreateRetentionPolicyAssignmentAsync_ForRetentionPolicyAssignmentRequest_ShouldSuccess() | ||
{ | ||
var adminFolder = await CreateFolderAsAdmin("0"); | ||
var retentionPolicy = await CreateRetentionPolicy(); | ||
var policyAssignmentReq = new BoxRetentionPolicyAssignmentRequest() | ||
{ | ||
PolicyId = retentionPolicy.Id, | ||
AssignTo = new BoxRequestEntity() | ||
{ | ||
Id = adminFolder.Id, | ||
Type = BoxType.folder | ||
} | ||
}; | ||
var policyAssignment = await AdminClient.RetentionPoliciesManager.CreateRetentionPolicyAssignmentAsync(policyAssignmentReq); | ||
Assert.AreEqual(retentionPolicy.Id, policyAssignment.RetentionPolicy.Id); | ||
Assert.AreEqual(adminFolder.Id, policyAssignment.AssignedTo.Id); | ||
|
||
var result = await AdminClient.RetentionPoliciesManager.DeleteRetentionPolicyAssignmentAsync(policyAssignment.Id); | ||
Assert.IsTrue(result); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters