Skip to content
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

Update arg validation #16885

Merged
merged 5 commits into from
Nov 12, 2020
Merged

Conversation

JoshLove-msft
Copy link
Member

@JoshLove-msft JoshLove-msft commented Nov 11, 2020

  • Assert that maxCount param is always >= 1
  • Handle empty sequenceNumber lists gracefully
  • Prevent null messageId/address/body in AMQP models
  • Avoid calling ToList when passed in IEnumerable is already a list

Bonus - minor updates to API

  • ServiceBusSessionProcessorOptions.SessionIds is List rather than array
  • ScheduleMessage returns IReadOnlyList rather than array

@JoshLove-msft
Copy link
Member Author

/azp run net - servicebus - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@JoshLove-msft
Copy link
Member Author

/azp run net - servicebus - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@@ -362,6 +362,11 @@ await using (var scope = await ServiceBusScope.CreateWithQueue(enablePartitionin
Assert.That(
async () => await receiver.ReceiveDeferredMessagesAsync(sequenceNumbers),
Throws.InstanceOf<ServiceBusException>().And.Property(nameof(ServiceBusException.Reason)).EqualTo(ServiceBusFailureReason.MessageNotFound));

// verify that an empty list can be passed

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: empty line.

@JoshLove-msft JoshLove-msft merged commit ed8416f into Azure:master Nov 12, 2020
annelo-msft pushed a commit to annelo-msft/azure-sdk-for-net that referenced this pull request Feb 17, 2021
* Update arg validation

* Update validation for AMQP models

* API updates

* Perf enhancements

* PR fb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants