locked
How to reuse unit tests written for Nunit to be used with Chess and execute Chess tool. RRS feed

  • Question

  • Hi,

    I have a set of unit tests written for my multi-threaded application to be executed using NUnit.

    I have seen some samples for chess tool, where extra attributes have been added to run with chess, embedded with visual studio.

    I have 2 questions

    1. Should new test cases be written to test an multi-threaded application using Chess, or can the existing NUnit test cases can be reused.

    2. There seems to be 2 ways to trigger chess.

        Either Command line:

        Make a exe over your dll(to be tested), and have a class ChessTest there which expects the complete list of test cases to be executed.

        Or Chess embedded in Visual studio:

        Decorate the unit test cases with the attributes expected by Chess and compile it as DLL and run with Visual studio framework.

        I tried the 1st approach, but Chess tool is throwing any errors/issues in my code. I think chess is not able to recognize my dlls properly. Could anyone please help me in identifying which way is better to execute chess tool.

    Thanks in advance!

     

    Regards,

    Ankit.

    Thursday, May 6, 2010 7:13 AM

Answers

  • The best way to go is to use the mchess tool. The way I do things is to have a single ChessTest class that allows the user to supply which test case to run (using reflection to find the right method).  This way you can reuse your unit tests as Chess tests. Best,

    -- Tom

    Saturday, May 8, 2010 8:02 PM

All replies

  • The best way to go is to use the mchess tool. The way I do things is to have a single ChessTest class that allows the user to supply which test case to run (using reflection to find the right method).  This way you can reuse your unit tests as Chess tests. Best,

    -- Tom

    Saturday, May 8, 2010 8:02 PM
  • Hi Tom,

    Can you please show the example of "single ChessTest class that allows the user to supply which test case to run (using reflection to find the right method)"?

     

    Thanks,

    Lana

    Wednesday, May 19, 2010 8:45 PM
  • I've as much as said this on the forums before, but by God I wish you'd shipped with a mstest-compliant entry point scheme (eg instance methods, not static methods)...
    Tuesday, July 20, 2010 11:45 AM