question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Samples for Mocking Client Types

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
jsquirecommented, 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.

0reactions
samjones00commented, Feb 11, 2022

Should this issue still have the status of Open?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Samples for Mocking Client Types · Issue #17380
Implement a sample or set of samples demonstrating a basic approach for mocking the high level client types for their core scenarios. Included ......
Read more >
Mocking with examples
In Postman, mock servers rely on examples saved in a collection to return mock data. Follow the steps below to get a hands-on...
Read more >
Mock gRPC client in tests
To demonstrate client app tests, review the following type in the sample app. View or download sample code (how to download). The Worker...
Read more >
Type-safe API mocking with Mock Service Worker and ...
I've got a question - Is it possible to add types for query params? For example when we want to mock a request:...
Read more >
Mockito mock examples
Let's look at different methods through which we can mock a class and stub its behaviors. Mockito mock method. We can use Mockito...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found