locked
Unit Testing a Modular WPF Application RRS feed

  • Question

  • I recently asked the following question "Can anybody point me to an example of unit testing in a WPF modular application with Prism and Unity? ".  The answer pointed me to a couple of pages that answered my question, but I found that I had not asked the right question.  I should have asked something like, "If I have a WPF solution with multiple modular projects, should I have a separate unit test project for each corresponding modular project, or should I have one test project that includes testing for all projects?

    For example, if I have a solution with projects called MyApp, MyApp.ModuleA and MyApp.ModuleB, should I have a unit test project, maybe called MyApp.Tests, that does all of the testing for all three of the modules, or should I have three unit test projects like MyApp.Tests, MyApp.ModuleA.Tests and MyApp.ModuleB.Tests? 

      

    Rob E.

    Saturday, April 29, 2017 11:39 PM

Answers

  • Hi Rob,

    If the question is only Can a single unit test project that can handle all modular projects within your solution? The answer is Yes.

    But when to proceed next step I would say it depends. Personally, I tend to put all the tests in a single project, with separate folders within the project for each assembly (plus further sub-folders if necessary.) This makes it easy to run the entire set within Visual Studio.

    If you have thousands of tests, a single project might prove too difficult to maintain. We usually split them out because we don't want to deploy them with our product. Whether you split them out per library or per solution there are merits to both.

     

    Hope it helps.

    Best regards,

    Fletch


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by REvans611 Monday, May 1, 2017 4:43 AM
    Monday, May 1, 2017 1:38 AM

All replies

  • Hi,

    For your case is about Uint Testing, I will move your thread toVisual Studio Development  Visual Studio Unit Testing Forum for suitable help.

    Your understanding and cooperation will be grateful.

    Best Regards,

    Bob


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, May 1, 2017 1:16 AM
  • Hi Rob,

    If the question is only Can a single unit test project that can handle all modular projects within your solution? The answer is Yes.

    But when to proceed next step I would say it depends. Personally, I tend to put all the tests in a single project, with separate folders within the project for each assembly (plus further sub-folders if necessary.) This makes it easy to run the entire set within Visual Studio.

    If you have thousands of tests, a single project might prove too difficult to maintain. We usually split them out because we don't want to deploy them with our product. Whether you split them out per library or per solution there are merits to both.

     

    Hope it helps.

    Best regards,

    Fletch


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by REvans611 Monday, May 1, 2017 4:43 AM
    Monday, May 1, 2017 1:38 AM