-
Notifications
You must be signed in to change notification settings - Fork 560
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expose IErrorHandler and add test case.
- Loading branch information
1 parent
43b91da
commit 6bf8c8c
Showing
8 changed files
with
190 additions
and
0 deletions.
There are no files selected for viewing
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
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
51 changes: 51 additions & 0 deletions
51
...ivate.ServiceModel/tests/Scenarios/Client/ExpectedExceptions/CallbackErrorHandlerTests.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,51 @@ | ||
// 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.ServiceModel; | ||
using Infrastructure.Common; | ||
using Xunit; | ||
|
||
public partial class CallbackErrorHandlerTests : ConditionalWcfTest | ||
{ | ||
[WcfFact] | ||
public static void DuplexCallbackErrorHandlerTest() | ||
{ | ||
bool result; | ||
InstanceContext context; | ||
string testString=""; | ||
NetTcpBinding binding; | ||
EndpointAddress endpointAddress; | ||
DuplexChannelFactory<IWcfDuplexService_CallbackErrorHandler> factory; | ||
IWcfDuplexService_CallbackErrorHandler serviceProxy; | ||
WcfDuplexService_CallbackErrorHandler_Callback callbackService; | ||
|
||
// *** SETUP *** \\ | ||
binding = new NetTcpBinding(); | ||
binding.Security.Mode = SecurityMode.None; | ||
callbackService = new WcfDuplexService_CallbackErrorHandler_Callback(); | ||
context = new InstanceContext(callbackService); | ||
endpointAddress = new EndpointAddress(Endpoints.DuplexCallbackErrorHandler_Address); | ||
factory = new DuplexChannelFactory<IWcfDuplexService_CallbackErrorHandler>(context, binding, endpointAddress); | ||
serviceProxy = factory.CreateChannel(); | ||
|
||
try | ||
{ | ||
// *** EXECUTE *** \\ | ||
result = serviceProxy.Hello(testString); | ||
|
||
// *** CLEANUP *** \\ | ||
((ICommunicationObject)serviceProxy).Close(); | ||
factory.Close(); | ||
} | ||
finally | ||
{ | ||
// *** ENSURE CLEANUP *** \\ | ||
ScenarioTestHelpers.CloseCommunicationObjects((ICommunicationObject)serviceProxy, factory); | ||
} | ||
|
||
// *** ADDITIONAL VALIDATION *** \\ | ||
Assert.True(result); | ||
} | ||
} |
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
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