public void MorseTranslateTestSimplePasses() { // Use the Assert class to test conditions. GameObject morseGraph = GameObject.FindGameObjectWithTag("MorseCode"); MorseCodeTranslator morseTranslator = morseGraph.GetComponent <MorseCodeTranslator>(); morseTranslator.InitializeDictionary(); Assert.AreEqual(morseTranslator.TranslateLetter("-.-"), "k"); Assert.AreEqual(morseTranslator.TranslateLetter("-.-."), "kc"); Assert.AreEqual(morseTranslator.TranslateLetter(".-."), "kcr"); }
public IEnumerator MorseTranslateTestWithEnumeratorPasses() { // Use the Assert class to test conditions. // yield to skip a frame GameObject morseGraph = GameObject.FindGameObjectWithTag("MorseCode"); MorseCodeTranslator morseTranslator = morseGraph.GetComponent <MorseCodeTranslator>(); Assert.AreEqual(morseTranslator.TranslateLetter("-.-"), "k"); Assert.AreEqual(morseTranslator.TranslateLetter("-.-."), "kc"); Assert.AreEqual(morseTranslator.TranslateLetter(".-."), "kcr"); yield return(null); }