forked from dotnet/wcf
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request dotnet#1604 from roncain/IChannelInitializer
Add IChannelInitializer to public API
- Loading branch information
Showing
4 changed files
with
171 additions
and
0 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
src/System.Private.ServiceModel/tests/Common/Unit/MockChannelInitializer.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System; | ||
using System.ServiceModel; | ||
using System.ServiceModel.Channels; | ||
using System.ServiceModel.Description; | ||
using System.ServiceModel.Dispatcher; | ||
|
||
public class MockChannelInitializer : IChannelInitializer | ||
{ | ||
public MockChannelInitializer() | ||
{ | ||
InitializeOverride = DefaultInitialize; | ||
} | ||
|
||
public Action<IClientChannel> InitializeOverride { get; set; } | ||
|
||
public void Initialize(IClientChannel channel) | ||
{ | ||
InitializeOverride(channel); | ||
} | ||
|
||
public void DefaultInitialize(IClientChannel channel) | ||
{ | ||
} | ||
} |
58 changes: 58 additions & 0 deletions
58
src/System.Private.ServiceModel/tests/Common/Unit/MockEndpointBehavior.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System; | ||
using System.ServiceModel.Channels; | ||
using System.ServiceModel.Description; | ||
using System.ServiceModel.Dispatcher; | ||
|
||
public class MockEndpointBehavior : IEndpointBehavior | ||
{ | ||
public MockEndpointBehavior() | ||
{ | ||
ValidateOverride = DefaultValidate; | ||
AddBindingParametersOverride = DefaultAddBindingParameters; | ||
ApplyDispatchBehaviorOverride = DefaultApplyDispatchBehavior; | ||
ApplyClientBehaviorOverride = DefaultApplyClientBehavior; | ||
} | ||
|
||
public Action<ServiceEndpoint> ValidateOverride { get; set; } | ||
public Action<ServiceEndpoint, BindingParameterCollection> AddBindingParametersOverride { get; set; } | ||
public Action<ServiceEndpoint, EndpointDispatcher> ApplyDispatchBehaviorOverride { get; set; } | ||
public Action<ServiceEndpoint, ClientRuntime> ApplyClientBehaviorOverride { get; set; } | ||
|
||
public void Validate(ServiceEndpoint endpoint) | ||
{ | ||
ValidateOverride(endpoint); | ||
} | ||
public void DefaultValidate(ServiceEndpoint endpoint) | ||
{ | ||
} | ||
|
||
public void AddBindingParameters(ServiceEndpoint endpoint, BindingParameterCollection bindingParameters) | ||
{ | ||
AddBindingParametersOverride(endpoint, bindingParameters); | ||
} | ||
|
||
public void DefaultAddBindingParameters(ServiceEndpoint endpoint, BindingParameterCollection bindingParameters) | ||
{ | ||
} | ||
|
||
public void ApplyDispatchBehavior(ServiceEndpoint endpoint, EndpointDispatcher endpointDispatcher) | ||
{ | ||
ApplyDispatchBehaviorOverride(endpoint, endpointDispatcher); | ||
} | ||
|
||
public void DefaultApplyDispatchBehavior(ServiceEndpoint endpoint, EndpointDispatcher endpointDispatcher) | ||
{ | ||
} | ||
|
||
public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime) | ||
{ | ||
ApplyClientBehaviorOverride(endpoint, clientRuntime); | ||
} | ||
public void DefaultApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime) | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters