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.
  2. Dismiss Notice

Question Addressables Mock in PlayMode tests

Discussion in 'Addressables' started by EduardDraude, Nov 11, 2020.

  1. EduardDraude

    EduardDraude

    Joined:
    Mar 8, 2019
    Posts:
    60
    Hello!

    I have a strange issue. I want to test a class in PlayMode. This class gets some assets via Addressables, so async. At some point when all handles are done (handle.isDone == true) the class dispatches some action. In my test I wait for this dispatched action. And that worked! But further, this class additionally loads more asstes via AssetReferences and now the tests get stuck, because these handles never become isDone == true. On Runtime everything works as expected.
    Did someon face a similiar issue or has an idea?

    Or is there a way to mock the addressables?
     
    Last edited: Nov 16, 2020
    Ruchir likes this.
  2. TreyK-47

    TreyK-47

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    1,796
    Let me bounce this off of the team for some guidance. Which version of Addressables are you using?
     
  3. EduardDraude

    EduardDraude

    Joined:
    Mar 8, 2019
    Posts:
    60
    Using Version 1.16.10 with Unity 2020.1.8.f1
     
    TreyK-47 likes this.
  4. TreyK-47

    TreyK-47

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    1,796
    Thanks! Forwarded to the team. They are going to do some investigating on this one. I'll update you as soon as I hear more.
     
    EduardDraude likes this.
  5. EduardDraude

    EduardDraude

    Joined:
    Mar 8, 2019
    Posts:
    60
    Any news on this? I have real trouble testing my code, which use addressables.