locked
How to write unit test case for WCF service both success and failure test cases. RRS feed

  • Question

  • Hi

    Please suggest me how to write unit test cases for wcf service, Please provide some sample code.

    Regards

    JCReddy


    jaya
    Wednesday, September 15, 2010 7:29 AM

Answers

  • There is nothing specific in the unit test framework for wcf service. You can leverage the unit test framework for Asserts and data driven testing.

    You could write helper functions which send http request and receive http response using HttpWebRequest and HttpWebResponse. You can then parse the response and compare the actual status codes with expected status codes.

    Thanks,

    Anuj

    Wednesday, September 22, 2010 10:06 PM