EndpointDispatcher and ClientRuntime
- Dominant language
- C#
- Stars
- 1.8k
- Forks
- 576
- Avg merge
- 6d 9h
- Merged PRs (30d)
- 2
Description
Is there any alternative to accessing the `ClientRuntime` from `EndpointDispatcher`?
It seems that in .NET 5.0, using System.ServiceModel 4.8.1, `EndpointDispatcher` class is completely empty, only contains a single empty constructor.
We used to have some tests that would check that an `IEndpointBehavior` was properly added to the client using WCF.
```
var myEndpointBehavior = new MyEndpointBehavior();
var serviceEndpoint = new ServiceEndpoint(new ContractDescription("localhost"));
var dispatcher = new EndpointDispatcher(new EndpointAddress("http://localhost"), "", ""); // <--- Error because EndpointDispatcher class is totally empty
var clientRuntime = dispatcher.DispatchRuntime.CallbackClientRuntime; // <---- does not exist
clientRuntime.ClientMessageInspectors.Should().HaveCount(0);
myEndpointBehavior.ApplyClientBehavior(serviceEndpoint, clientRuntime);
clientRuntime.ClientMessageInspectors.Should().HaveCount(1);
clientRuntime.ClientMessageInspectors.First().Should().BeOfType();
```
Is there any way to test this same behavior in .NET 5.0?
I have been trying to find a way to access the `ClientRuntime` but haven't really found anything
Contributor guide
Assessment
This issue has not been assessed yet.