[Core] Move Mocking Transport to Azure.Core
See original GitHub issueAPI Change Needed
Yes
Background and motivation
Currently Azure.Core request, response, and transport are all very abstract. Implementing a simple “mocking” or a custom transport (e.g. a transport that injects faults) requires a lot of boilerplate code. It would be great to have some simple subtypes of Request, Response, and possibly the transport in Azure.Core.
We have such types in our testing framework, but they need to be cleaned up and the transport needs to be decoupled from recording framework.
API / Feature Proposal
namespace Azure.Core.Pipeline
{
public class CoreResponse : Response
{
}
public class CoreRequest : Request
{
}
}
Time Constraints and Dependencies
No deadline
Stakeholders
Issue Analytics
- State:
- Created a year ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Source code for azure.core.pipeline.transport._base
Source code for azure.core.pipeline.transport. ... Union, Any, Mapping, Dict, Optional, Tuple, Iterator, ) from six.moves.http_client import HTTPConnection, ...
Read more >How to Mock the File System for Unit Testing in .NET
In this article, we are going to learn how to mock the file system and unit test a component that interacts with the...
Read more >Mocking azure file libraries for uploading a file from local to ...
I have a service class where I have a method implementing upload functionality to Azure file storage using Azure storage libraries such as ......
Read more >Azure Service Bus client library for .NET
Use the client library for Azure Service Bus to: Transfer business data: leverage messaging for durable exchange of information, ...
Read more >How To Simplify C# Unit Testing With a Mocking Framework
The quickest way to take your unit testing to the next level is with a mocking framework. Let's see how they work together....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Wouldn’t users of the SDK just mock the client directly rather than getting involved with the implementation details of the transport?
Mocking responses is discussed here - https://devblogs.microsoft.com/azure-sdk/unit-testing-and-mocking/#response. This can be done already using Moq.