close
The Wayback Machine - https://web.archive.org/web/20210806102552/https://github.com/Azure/azure-sdk-for-net/issues/7382
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

Samples for Mocking Client Types #7382

Open
jsquire opened this issue Aug 23, 2019 · 4 comments
Open

Samples for Mocking Client Types #7382

jsquire opened this issue Aug 23, 2019 · 4 comments

Comments

@jsquire
Copy link
Member

@jsquire jsquire commented Aug 23, 2019

Summary

The Event Hubs client library aims to be mockable and fully support testability. To help illustrate usage of the new API for the testing scenarios, a set of samples mocking the various Event Hubs client types and illustrating use of the model factory is needed.

Scope of Work

  • Implement a sample or set of samples demonstrating a basic approach for mocking the high level client types for their core scenarios. Included should be:

    • EventHubProducerClient
    • EventHubConsumerClient
    • EventProcessorClient
    • PartitionReceiver
    • EventProcessor<TPartition>

  • Ensure that the use of the model factory is demonstrated for key types, including:

    • EventData
    • EventDataBatch
    • EventHubProperties
    • PartitionProperties
    • PartitionPublishingProperties
    • LastEnqueuedEventProperties
    • PartitionContext

Success Criteria

  • The sample(s) have been created, with a clear and simple approach and detailed discussion to support the goal of helping those unfamiliar with Event Hubs to get started testing its types.

  • The sample(s) adhere to the coding conventions and standards defined for track two libraries.

  • All projects in the solution compile; any warnings that exist have either been fixed or additional work items filed to address them if they were deemed non-critical.

  • The sample(s) follow the pattern within the Event Hubs library, are compiled and executed as part of the Live test suite.

References

@ACHYUT001
Copy link

@ACHYUT001 ACHYUT001 commented May 1, 2021

Hi @jsquire,
If this is still open, I'd like to take this up.

@jsquire
Copy link
Member Author

@jsquire jsquire commented May 10, 2021

Hi @ACHYUT001. Apologies for missing the notification on this earlier. Your contribution would be greatly appreciated. Our goal here would be to demonstrate the types mentioned in the scope, and I think the best way to do that would be to try and mirror some of the core scenarios that we demonstrate in our publishing, consuming, and processing samples.

As you may already be aware, our samples are markdown-based and with the code driven from snippets defined in our test suite. I added a few more references to the issue description that may help you get started. Since this work is based around unit testing, we can probably avoid Live tests and just stick with unit tests - like the first set of snippets above.

I'm happy to help you along as best I can; please feel free to use a draft PR to share ideas and start discussion, just mention me when you'd like my thoughts. Thank you for helping to make the Azure SDK experience better!

@ACHYUT001
Copy link

@ACHYUT001 ACHYUT001 commented May 31, 2021

Hi @jsquire ,

Sorry, been a little away past few days.
I'll pick this up and have a draft PR done by EoW.

Thanks

@ACHYUT001
Copy link

@ACHYUT001 ACHYUT001 commented Jun 5, 2021

Hi @jsquire ,

I've started out writing the mocks.
Here are a few for Publishing, requesting your thoughts : PR21630
Should I cover all the scenarios as done in the publishing sample?

I also needed your assistance in understanding the points to cover in the markdown file of the sample.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants