Search Unity

  1. Unity 2019.1 is now released.
    Dismiss Notice

EditMode Unit Test passes in Editor, fails during Cloud Build

Discussion in 'Unity Cloud Build' started by vinnie-vivace, Apr 24, 2019.

  1. vinnie-vivace

    vinnie-vivace

    Joined:
    Jan 12, 2010
    Posts:
    33
    Greetings everyone. I have a very simple UnitTest that checks if an object exists in the main scene of a project. This test passes fine in the Editor, but fails during Cloud Build.

    Code (CSharp):
    1.  
    2. [Test]
    3. public void GameModeMatchesPlatform()
    4. {
    5.       var gameManager = Object.FindObjectOfType<GameManager>();
    6.  
    7.       Assert.NotNull(gameManager);
    8. }
    9.  
    Can anyone shed light on this please?