Esempio n. 1
0
    public void TestGetNextAtomBounds()
    {
        ContentNode contentNode = new ContentNode();

        populateSimpleAtoms();
        contentNode.InitialiseAtoms(atoms);
        contentNode.currentAtom = atoms[9];
        ESTrainingAtom a = contentNode.FindNextAtom();

        Assert.AreEqual(null, a);
    }
Esempio n. 2
0
    public void TestFreshInitialisationOfAtomsWithoutPlayerPrefs()
    {
        PlayerPrefs.DeleteAll();
        PlayerPrefs.Save();

        ContentNode contentNode = new ContentNode();

        populateSimpleAtoms();

        contentNode.InitialiseAtoms(atoms);

        Assert.AreEqual(contentNode.currentNodeID, "id_0");
        Assert.AreEqual(contentNode.currentNodeCompleted, false);
        Assert.AreSame(atoms[0], contentNode.currentAtom);
    }
Esempio n. 3
0
    public void TestFreshInitialisationOfAtomsWithPlayerPrefsAndMissingAtom()
    {
        PlayerPrefs.DeleteAll();

        ContentNode contentNode = new ContentNode();

        populateSimpleAtoms();

        PlayerPrefs.SetString("currentNodeID", "id_missingAtom");
        PlayerPrefs.SetInt("currentNodeCompleted", 1);
        PlayerPrefs.Save();

        contentNode.InitialiseAtoms(atoms);

        Assert.AreEqual(contentNode.currentNodeID, "id_0");
        Assert.AreEqual(contentNode.currentNodeCompleted, false);
        Assert.AreSame(atoms[0], contentNode.currentAtom);
    }