jeudi 26 novembre 2015

How to mock web service in c# unit test

Any solution to mock a web service in wpf ? I tried this one but it throws an error

dataService.Setup(x => x.GetInstance().Proxy.LoginUser(request.Object)).Returns(response);

Exception is -

An exception of type 'System.InvalidOperationException' occurred in System.ServiceModel.dll but was not handled in user code

Additional information: Could not find endpoint element with name and contract in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this name could be found in the client element.

Aucun commentaire:

Enregistrer un commentaire