Search Unity

Unity Testing Tools - From C# to DLL

Discussion in 'Editor & General Support' started by srivello, Sep 21, 2016.

  1. srivello

    srivello

    Joined:
    Jan 16, 2011
    Posts:
    16
    I have custom C# classes that to run tests. My c# calls the "Unity Testing Tools" C# for both UnitTests and IntegrationTests. This works in Unity Testing Tools v1.5.6.

    Today I updated from v1.5.6 to the latest version v1.5.9. I see that some of the C# has moved into Unity DLL. Overall that is a welcome sign of support and maturity for the feature. Great work!

    After the upgrade;
    • My custom c# calls the "Unity Testing Tools" c# for integration tests. Works great.
    • My custom c# calling the Unit Tests is broken, because Unit Test API is changed. Unit Test code is now in a DLL. Essentially I want to mimic what happens when the Unity menu option (see attached) is clicked.
    I'm aware of how to call both from command line. However, my desire is to call from C#.

    Questions
    1. How can I call (from C#) to run the Unit Tests?
    2. When I do that, how can I capture when the testing is complete, so that I can get the results, and parse them into a custom format. I did this in 1.5.6 and want to do so in 1.5.9.
     

    Attached Files:

    Last edited: Sep 21, 2016
  2. Tomek-Paszek

    Tomek-Paszek

    Unity Technologies

    Joined:
    Nov 13, 2012
    Posts:
    116
  3. srivello

    srivello

    Joined:
    Jan 16, 2011
    Posts:
    16
    Thanks for the feedback. Using your advice, I migrated my custom code from using Unity Testing Tools package 1.5.6 to 1.5.9. Done! :)