Reputation: 21
This is the method i used to call my wcf service method(GetCountry) through interface IService1.Which implement channel factory
public IList<Country> GetCountry()
{
ChannelFactory<ServiceLibrary.IService1> channelFactory = new ChannelFactory<IService1>(binding, address);
IService1 channel1 = channelFactory.CreateChannel();
var response= channel1.GetCountry();
return response;
}
How to mock the service call using NUNIT?
Upvotes: 2
Views: 876
Reputation: 35
you cant mock directly . Use any mocking framework and Isolate the service call and get the result of service by some dummy values Isolate.whencalled.willReturn(serviceValue)
Upvotes: 1