I am writting test cases for a Unity Project. I wanted to create a instance of a Monobehaviour class.
Problem: Null value when I am trying to find game object with the tag.
Code:
[UnityTest]
public IEnumerator DummyTestWithEnumeratorPasses() {
GameObject dummyController = GameObject.FindWithTag("dummyControllerTag");
Debug.Log (dummyController); // Null always.
yield return null;
}
Snapshot:
EDIT:
After the comments, here is my new code that matches the tag name:
[UnityTest]
public IEnumerator DummyTestWithEnumeratorPasses() {
GameObject CUIController = GameObject.FindWithTag("CUIControllerTag");
Debug.Log (CUIController); // Null always.
yield return null;
}