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

Closed
jsquire opened this issue Aug 23, 2019 · 6 comments
Closed

Samples for Mocking Client Types #7382

jsquire opened this issue Aug 23, 2019 · 6 comments
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. Event Hubs
Milestone

Comments

@jsquire
Copy link
Member

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.

Related

The following are promising pull requests begun by a community member before they were unable to complete due to time constraints. These would serve as a great starting point.

References

@jsquire jsquire added Event Hubs Client This issue points to a problem in the data-plane of the library. Up for grabs labels Aug 23, 2019
@AlexGhiondea AlexGhiondea added this to the Backlog milestone Mar 3, 2020
@jsquire jsquire added good first issue This issue tracks work that may be a good starting point for a first-time contributor help wanted This issue is tracking work for which community contributions would be welcomed and appreciated and removed Up for grabs labels Sep 8, 2020
@ACHYUT001
Copy link

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

@jsquire
Copy link
Member Author

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

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 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

@samjones00
Copy link

Should this issue still have the status of Open?

@jsquire
Copy link
Member Author

jsquire commented Feb 11, 2022

Yes, this work has not been completed. There have been some contributions that formed a good foundation for the samples, but there is still some work needed to complete the sample.

@jsquire jsquire modified the milestones: Backlog, [2022] June Apr 8, 2022
@jsquire jsquire removed help wanted This issue is tracking work for which community contributions would be welcomed and appreciated good first issue This issue tracks work that may be a good starting point for a first-time contributor labels Apr 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Client This issue points to a problem in the data-plane of the library. Event Hubs
Projects
None yet
Development

No branches or pull requests

5 participants