Search Unity

Looking for Advice - Challenges with Testing my code and 3rd party packages

Discussion in 'Testing & Automation' started by jmguillemette, Sep 5, 2022.

  1. jmguillemette

    jmguillemette

    Joined:
    Mar 4, 2015
    Posts:
    53
    Here is my challenge.

    I like to test my code. I find following a TDD approach makes for better code and more modular solutions.
    However, I also like using some 3rd party add-ons that do dumb things like not package their code in assemblies and write code that has no namespaces so they live in the "Editor" space within unity.

    The problem here is that my assembly separate code can not reference the non-assembly code of the 3rd party add-ons.

    Does anyone know a workaround or have suggestions for dealing with this sort of issue?
    I really don't want to remove my tests and assemblies just to be able to use these add-ons.

    An example of a "bad citizen" add-on: Photon Fusion multiplayer library.

    upload_2022-9-5_12-35-59.png
     
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    5,870
    I frequently find myself manually adding assembly definitions to such code frameworks. There's really nothing else you can do besides fixing what they didn't provide.

    But definitely check if there's maybe a separate release as UPM package. For instance, you may be using a general C# framework rather than its counterpart that is (more) compatible with Unity.

    Or maybe it's a free vs commercial version thing? Or just very old version?