Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,31 @@ public void ApplyClientBehaviorToClientRuntime_WithNullActionOperation_DoesNotTh
}
}

#if NETFRAMEWORK
[Fact]
public void ApplyDispatchBehaviorToEndpoint_WithNullActionOperation_DoesNotThrow()
{
// Arrange
var endpointDispatcher = new EndpointDispatcher(
new EndpointAddress("http://localhost/something"),
contractName: "Service",
contractNamespace: "http://opentelemetry.io/");

endpointDispatcher.DispatchRuntime.Operations.Add(
new DispatchOperation(
endpointDispatcher.DispatchRuntime,
name: "NullActionOperation",
action: null));

// Act
var exception = Record.Exception(() => TelemetryEndpointBehavior.ApplyDispatchBehaviorToEndpoint(endpointDispatcher));

Comment thread
martincostello marked this conversation as resolved.
// Assert
Assert.Null(exception);
Assert.Single(endpointDispatcher.DispatchRuntime.MessageInspectors);
}
#endif

private sealed class InjectNullActionOperationBehavior : IEndpointBehavior
{
public void AddBindingParameters(ServiceEndpoint endpoint, BindingParameterCollection bindingParameters)
Expand Down
Loading