-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Add test for device pinners (box/box-codegen#443) (#36)
- Loading branch information
1 parent
c2978b6
commit 98bcbd3
Showing
5 changed files
with
44 additions
and
6 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1 +1 @@ | ||
{ "engineHash": "9f6df0d", "specHash": "b2f7568", "version": "0.1.0" } | ||
{ "engineHash": "9836a44", "specHash": "b2f7568", "version": "0.1.0" } |
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
29 changes: 29 additions & 0 deletions
29
Box.Sdk.Gen.Tests.Integration/Test/DevicePinners/DevicePinnersManagerTests.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,29 @@ | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
using NullableExtensions; | ||
using System; | ||
using Box.Sdk.Gen; | ||
using Box.Sdk.Gen.Schemas; | ||
using Box.Sdk.Gen.Managers; | ||
|
||
namespace Box.Sdk.Gen.Tests.Integration { | ||
[TestClass] | ||
public class DevicePinnersManagerTests { | ||
public BoxClient client { get; } | ||
|
||
public DevicePinnersManagerTests() { | ||
client = new CommonsManager().GetDefaultClient(); | ||
} | ||
[TestMethod] | ||
public async System.Threading.Tasks.Task TestDevicePinners() { | ||
string enterpriseId = Utils.GetEnvVar(name: "ENTERPRISE_ID"); | ||
DevicePinners devicePinners = await client.DevicePinners.GetEnterpriseDevicePinnersAsync(enterpriseId: enterpriseId).ConfigureAwait(false); | ||
Assert.IsTrue(NullableUtils.Unwrap(devicePinners.Entries).Count >= 0); | ||
DevicePinners devicePinnersInDescDirection = await client.DevicePinners.GetEnterpriseDevicePinnersAsync(enterpriseId: enterpriseId, queryParams: new GetEnterpriseDevicePinnersQueryParams() { Direction = GetEnterpriseDevicePinnersQueryParamsDirectionField.Desc }).ConfigureAwait(false); | ||
Assert.IsTrue(NullableUtils.Unwrap(devicePinnersInDescDirection.Entries).Count >= 0); | ||
const string devicePinnerId = "123456"; | ||
await Assert.That.IsExceptionAsync(async() => await client.DevicePinners.GetDevicePinnerByIdAsync(devicePinnerId: devicePinnerId).ConfigureAwait(false)); | ||
await Assert.That.IsExceptionAsync(async() => await client.DevicePinners.DeleteDevicePinnerByIdAsync(devicePinnerId: devicePinnerId).ConfigureAwait(false)); | ||
} | ||
|
||
} | ||
} |
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