-
Notifications
You must be signed in to change notification settings - Fork 5.1k
[Communication] - PhoneNumberAdministrationClient - fix next page #17283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
d36bcf5
4fae158
79b322e
b8f6abb
ae7d46f
cc41d52
533d05b
101a251
436975c
6d4dbd5
4131466
7f7b424
0fff2cb
ee20b85
ee4ac2c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -58,6 +58,36 @@ public async Task GetAllPhoneNumbers() | |
| Assert.IsNotNull(numbers); | ||
| } | ||
|
|
||
| [Test] | ||
| public async Task GetAllReservations() | ||
| { | ||
| // Arrange | ||
| var client = CreateClient(); | ||
|
|
||
| const string locale = "en-US"; | ||
| const string countryCode = "US"; | ||
|
|
||
| var pageablePhonePlanGroups = client.GetPhonePlanGroupsAsync(countryCode, locale); | ||
| var phonePlanGroups = await pageablePhonePlanGroups.ToEnumerableAsync().ConfigureAwait(false); | ||
|
|
||
| string phonePlanGroupId = phonePlanGroups.First(group => group.PhoneNumberType == PhoneNumberType.TollFree).PhonePlanGroupId; | ||
| var pageablePhonePlans = client.GetPhonePlansAsync(countryCode, phonePlanGroupId, locale); | ||
| var phonePlan = (await pageablePhonePlans.ToEnumerableAsync()).First(); | ||
| var areaCode = phonePlan.AreaCodes.First(); | ||
|
|
||
| var reservationOptions = new CreateReservationOptions("My reservation", "my description", new[] { phonePlan.PhonePlanId }, areaCode); | ||
| reservationOptions.Quantity = 1; | ||
| var reservationOperation = await client.StartReservationAsync(reservationOptions); | ||
|
|
||
| await reservationOperation.WaitForCompletionAsync().ConfigureAwait(false); | ||
|
|
||
| // Act | ||
| var reservationsPagable = client.GetAllReservationsAsync(); | ||
| var reservations = await reservationsPagable.ToEnumerableAsync(); | ||
|
|
||
| Assert.IsNotEmpty(reservations); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we guarantee that this is not empty on a fresh created resource and where we can't guarantee the order in which the tests execute? Consider
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have added CreateReservation step to the test so there will be at least one reservation |
||
| } | ||
|
|
||
| [Test] | ||
| [TestCase(null, null)] | ||
| [TestCase("en-US", null)] | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding this 👍