Search Unity

Unity test can't access my code

Discussion in 'Scripting' started by Android272, Feb 13, 2019.

  1. Android272

    Android272

    Joined:
    Oct 14, 2016
    Posts:
    25
    So I am trying to work on a project using the TDD methodology. But I am getting an error sying that the class I am writing does not exist in the current context.

    Here is my folder structure

    ├── Editor
    │ └── Test
    │ ├── Tests
    │ └── myTest
    └── Scripts
    └── myScript

    Here is myTest

    Code (CSharp):
    1.         [UnityTest]
    2.         public IEnumerator VerifySigilNotTooLong() {
    3.             int[] sigil = new int[] { 1, 2, 1 };
    4.             int[] swipe = new int[] { 1, 2, 3, 1 };
    5.  
    6.             Assert.False(VerifySigil.CheckLength(sigil, swipe));
    7.         }
    and for now, here is myScript

    Code (CSharp):
    1. public class VerifySigil : MonoBehaviour {
    2.     public static bool CheckLength(int[] sigil, int[] swipe) {
    3.         return false;
    4.     }
    5. }

    I don't know why I am getting the error
    The name 'VerifySigil' does not exist in the current context


    Do I have everything in the right folders?