Search Unity

Question Script templates for Nunit tests: Assembly definition issue

Discussion in 'Testing & Automation' started by EdwigeLelievre, Jan 4, 2022.

  1. EdwigeLelievre

    EdwigeLelievre

    Joined:
    Nov 17, 2021
    Posts:
    1
    Hi! I'm working with Test Framework in Unity. I managed to create a test folder and basic editmode and playmode tests without issue (and I am used to running tests in Unity).

    For more comfort I would like to create Script Templates for tests (editmode and playmode). I added a similar assembly definition to the one in tests folder in the ScriptTemplates folder, but the Nunit framwork is still not accessible from my script template.

    Here is the assembly I created for the ScriptTemplates folder:
    Code (csharp):
    1. {
    2.     "name": "ScriptTemplates",
    3.     "rootNamespace": "",
    4.     "references": [
    5.         "UnityEngine.TestRunner",
    6.         "UnityEditor.TestRunner"
    7.     ],
    8.     "includePlatforms": [],
    9.     "excludePlatforms": [],
    10.     "allowUnsafeCode": false,
    11.     "overrideReferences": true,
    12.     "precompiledReferences": [
    13.         "nunit.framework.dll"
    14.     ],
    15.     "autoReferenced": false,
    16.     "defineConstraints": [
    17.         "UNITY_INCLUDE_TESTS"
    18.     ],
    19.     "versionDefines": [],
    20.     "noEngineReferences": false
    21. }
    Does anyone encountered the issue and would have a solution?