none
How to unit test WCF service methods using Microsoft Unity Application block and Microsoft Fakes in VS 2012? RRS feed

  • Question

  • Hi,

    I want to unit test WCF service methods using Microsoft Unity Application Blocks and Fakes Framework in VS 2012.

    I was able to test service methods by creating fake data access component. How can I do the same using Fakes Framework?

    Thanks,

    Suraj Naik

    Wednesday, July 10, 2013 6:24 AM

All replies


  • I was able to test service methods by creating fake data access component. How can I do the same using Fakes Framework?


    Hi,

    Microsoft Fakes framework helps you to test your code when you want to use some external variables whose values change randomly (like stocks) and you are using that in your code (you want to test this code, without bothering about the external factors). Another case could be testing something which i not yet complete.
    So in your code you have something which you want to test + Some external factors.

    Please try to refer to the following articles:

    #ow to unit test WCF service methods using Microsoft Fakes

    http://code.msdn.microsoft.com/windowsdesktop/Unit-Test-a-having-404c2a18 .

    http://www.jdibble.co.uk/blog/20/microsoft-fakes .

    Hope it can help you.

    Best Regards.


    Amy Peng
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.




    Friday, July 12, 2013 2:46 AM
    Moderator
  • Hi Amy,

    Thanks for the reply. The sample in code.msdn.microsoft.com/windowsdesktop/Unit-Test-a-having-404c2a18 has a different scenario i.e., unit test class library methods by isolating WCF service dependency (which class library had) using fakes framework.

    My scenario is unit test service layer methods by isolating class library component using Fakes framework.

    Thanks,

    Suraj Naik

    Friday, July 12, 2013 6:52 AM