Search Unity

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,562
    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,660
  3. liortal

    liortal

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