In my JsonReader.cs script, I have the following:
// file to read lessons from
public TextAsset jsonFile;
In the Unity editor, I have created a file: Assets/Resources/lesson-test.json, and dragged it to the jsonFile field of the script.
In my app, the following works fine:
// file to read lessons from
public TextAsset jsonFile;
void Start()
{
Assert.IsNotNull(jsonFile);
}
but from Test Runner, this fails:
[UnityTest]
public IEnumerator TestStart()
{
Assert.Pass();
yield return null;
}
TestStart (0.023s)
---
Unhandled log message: '[Exception] AssertionException: Assertion failure. Value was Null
Expected: Value was not Null'. Use UnityEngine.TestTools.LogAssert.Expect
---
UnityEngine.Assertions.Assert.Fail (System.String message, System.String userMessage) (at <f38c71c86aa64e299d4cea9fb7c715e1>:0)
UnityEngine.Assertions.Assert.IsNotNull (UnityEngine.Object value, System.String message) (at <f38c71c86aa64e299d4cea9fb7c715e1>:0)
UnityEngine.Assertions.Assert.IsNotNull[T] (T value, System.String message) (at <f38c71c86aa64e299d4cea9fb7c715e1>:0)
UnityEngine.Assertions.Assert.IsNotNull[T] (T value) (at <f38c71c86aa64e299d4cea9fb7c715e1>:0)
JsonReader.Start () (at Assets/Scripts/JsonReader.cs:41)
---
AssertionException: Assertion failure. Value was Null
Expected: Value was not Null
How do I make this TextAsset connect properly when running TestRunner?