Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unit Testing WCF Visual Studio 2010

Im writting unit test for a WCF service which i have written. The thing is when i run the Unit test it throw me error saying that there is no end point listening. I need to compile my WCF Service and later run the unit test.

Is there any other way where Unit Test runs and host the WCF service and later start testing.

Thanks in advance

like image 303
user1135534 Avatar asked May 29 '26 02:05

user1135534


1 Answers

Running a test against an actual WCF service would not be unit testing, it would be integration testing; if you want to do this you'd do it as part of an automated build process which deploys the service and then runs your tests.

To unit test your service, you should ignore the WCF aspect and call the service class directly, as if it were any other class.

like image 197
Steve Wilkes Avatar answered May 31 '26 23:05

Steve Wilkes



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!