locked
Any improvement in Unit Testing Universal Application ? RRS feed

  • Question

  • Hi all,

    I have a solution for both Windows Phone 8.1 and Windows 8.1, as i know, i have to unit test the projects separately.  So, is there any change for that ? Or, what's the best practice to unit test the shared part ?  Thanks !

    Regards.

    Dong. 

    Tuesday, November 18, 2014 6:37 AM

Answers

All replies

  • Hi Dong,

    You could create the unit test as the previous way, but I remember that it would have an issue if we want to run it in command line, this issue has been submitted to the connect report here:

    https://connect.microsoft.com/VisualStudio/feedback/details/1019751/error-running-windows-phone-unit-tests-with-vstest-console

    In addition, we cannot unit test a shared project separately.

    Reference:

    http://www.jevgeni.net/2014/04/06/shared-projects-portable-class-libraries-windows-8-1-windows-phone-8-1/

    When it comes to Unit Testing the major drawback of using a Shared Project is that you have to unit test your Windows app and Windows Phone app separately. You cannot unit test a shared project separately. For Portable Class Libraries you can write unit tests just to cover the logic within a library. So you will be unit testing a separate module, which is the right approach.

    Best Regards,

    Jack


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by wd0623 Wednesday, November 19, 2014 3:33 AM
    Wednesday, November 19, 2014 3:13 AM
  • Thanks, Jack !

    One more question:

    we have moved our build to build machines (VMs running on server) and all outputs are placed in a specific folder. We can download the build packages to local.  So, since we can trigger UT from command prompt, is it possible to do UT on a specific machine  for all  packages downloaded from build machines ? 

    Thanks.

    Dong.


    Wednesday, November 19, 2014 4:23 AM
  • Hi Dong,

    Thanks for your friendly response.

    You know that one thread for one issue, maybe opening a new thread for the new issue would be better.

    If possible, please share us more detailed information about the new in your new thread, for example, do you mean that you want to run your unit test remotely or others? I'm not very sure that what the packages are, but if you want to run the unit test project in your local machine, you would have the Windows phone libraries and the unit test projects, I doubt that it still has this issue if we run tests in command line, so we'd better install the VS IDE, and then run your test projects with it.

    If I have misunderstood this issue, please feel free to let me know.

    Best Regards,

    Jack


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, November 19, 2014 6:28 AM
  • Hi Jack,

    Thank you very much for  your help !

    I opened a new thread for the new question. The link : 

    https://social.msdn.microsoft.com/Forums/vstudio/en-US/35bebfd2-07bb-48b1-9d30-b239b0bcce05/windows-phone-81-ut-can-we-do-unit-testing-only-with-the-output-binaries-via-command-line?forum=vsunittest

    Thank you.

    Dong.

    Wednesday, November 19, 2014 6:46 AM
  • Thank you for your support and co-operation! Dong!:)

    Thanks,

    Jack


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, November 19, 2014 6:50 AM