这是我用来通过接口IService1调用我的wcf服务方法(GetCountry)的方法,它实现了通道工厂
public IList<Country> GetCountry()
{
ChannelFactory<ServiceLibrary.IService1> channelFactory = new ChannelFactory<IService1>(binding, address);
IService1 channel1 = channelFactory.CreateChannel();
var response= channel1.GetCountry();
return response;
}如何使用NUNIT模拟服务调用?
发布于 2014-01-09 00:31:06
你不能直接嘲笑。使用任何模拟框架并隔离服务调用,并通过一些虚拟值Isolate.whencalled.willReturn(serviceValue)获得服务的结果
https://stackoverflow.com/questions/21001106
复制相似问题