public void TestGetNextAtomBounds() { ContentNode contentNode = new ContentNode(); populateSimpleAtoms(); contentNode.InitialiseAtoms(atoms); contentNode.currentAtom = atoms[9]; ESTrainingAtom a = contentNode.FindNextAtom(); Assert.AreEqual(null, a); }
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); }
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); }