Skip to content

Instantly share code, notes, and snippets.

@cmatskas
Last active August 29, 2015 14:20
Show Gist options
  • Save cmatskas/64aec6048d18fa14283f to your computer and use it in GitHub Desktop.
Save cmatskas/64aec6048d18fa14283f to your computer and use it in GitHub Desktop.
WCF Custom Message handler
using APIConsumerServices.Services.CustomService;
using FluentAssertions;
using NUnit.Framework;
namespace APIConsumerServices.Services.Tests
{
[TestFixture]
public class CallServiceTest
{
// CustomClient is the wrapper around the WSDL generated proxy class
var testservice = new CustomClient(endpointname, endpoint);
var requestInterceptor = new CustomInspectorBehavior();
testservice.Endpoint.Behaviors.Add(requestInterceptor);
testservice.Open();
var channel = testservice.ChannelFactory.CreateChannel(endpoint);
var request = testservice.CreateCustomRequest();
var response = channel.SomeAbritraryMethod(request);
response.Should().NotBeNull("Results were returned successfully");
testservice.Close();
}
}
@cmatskas
Copy link
Author

cmatskas commented May 4, 2015

Changed language to C#

@cmatskas
Copy link
Author

cmatskas commented May 4, 2015

added .cs file extension

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment