Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Bug Making [UnityTest] work with [TestCaseSource]

Discussion in 'Testing & Automation' started by liortal, Jul 8, 2021.

  1. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,532
    I'm trying to create a parametric Unity play mode test (e.g: one that spans multiple frames).
    Here's an example of what i'm trying to do:
    Code (CSharp):
    1. [UnityTest]
    2. [TestCaseSource("LevelPaths")]
    3. public IEnumerator LoadLevel_VerifyWeAreGood(string levelPath)
    4. {
    5.     yield return null;
    6.  
    7.     // Test Logic Here
    8. }
    When running this in the test runner, the test fails, and i am getting this error:
    What am i doing wrong here?
     
  2. superpig

    superpig

    Drink more water! Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,569
  3. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,532
    Awesome thanks @superpig
    now just look at my other thread and we can call it a day :)