Search Unity

Resolved Using Moq in Playmode tests

Discussion in 'Testing & Automation' started by EduardDraude, Nov 9, 2020.

  1. EduardDraude

    EduardDraude

    Joined:
    Mar 8, 2019
    Posts:
    60
    Hi,

    I want to use Moq in my PlayMode tests. It works normally for the EditorMode tests.
    Moq.dll is referenced in my assembly, but I keep getting the error:

    The type or namespace name 'Moq' could not be found (are you missing a using directive or an assembly reference?)


    Does someone have a hint on this issue?

    Using Unity 2020.1.8f1 and using Extenject Plugin with its bundled Moq.dll (https://github.com/svermeulen/Extenject)
     
  2. EduardDraude

    EduardDraude

    Joined:
    Mar 8, 2019
    Posts:
    60
    Ok, I removed the Moq.dll which is bundled with Extenject and used the Unity one. It can be added in the manifest.json with
    "nuget.moq": "1.0.0"

    Also deleted the Library folder and restarted my Unity project. I don't know the difference between these .dll, but now it works :)