Hi everyone,
I am trying to write unit tests for a service that calls a SOAP service.
I tried creating an interface for it using the wsdl command in the cmd prompt.
It generates a file for me that has the interface for me.
However, it's for the .NET framework, so some of the namespaces that are in it are not part of .NET Core and I am having a compiling error.
Has anyone here worked on Mocking/Unit Testing a connected service so that we don't actually call the real service?
Unit Test Web Service .NET Core
Page 1 of 12 Replies - 805 Views - Last Post: 18 January 2019 - 10:02 AM
Replies To: Unit Test Web Service .NET Core
#2
Re: Unit Test Web Service .NET Core
Posted 18 January 2019 - 09:58 AM
#3
Re: Unit Test Web Service .NET Core
Posted 18 January 2019 - 10:02 AM
Yes, like Moq.
I don't want to actually call the SOAP service since this is a unit test and not an integration test. When I added the connected service in Visual Studio 2017, it creates a References.cs class for that connected service.
I wanted to Mock the contents of that file so that the service is never actually called when I create my unit tests.
I don't want to actually call the SOAP service since this is a unit test and not an integration test. When I added the connected service in Visual Studio 2017, it creates a References.cs class for that connected service.
I wanted to Mock the contents of that file so that the service is never actually called when I create my unit tests.
Page 1 of 1