예제 #1
0
        static void Main(string[] args)
        {
            string input;

            do
            {
                Console.WriteLine("Activating latent latin-like powers...");
                input = Console.ReadLine();

                Console.WriteLine("\nDid you mean:");
                Console.WriteLine(PigLatin.Translate(input));

                Console.WriteLine("\nContinue? (y/n)");
                input = Console.ReadLine();
                if (input == null)
                {
                    input = "";
                }

                Console.WriteLine();
            } while (input.ToLower().Equals("y"));
        }
예제 #2
0
 public void TranslatesBlanks()
 {
     Assert.Equal("", PigLatin.Translate(""));
 }
예제 #3
0
 public void TranslatesAllConsonants()
 {
     Assert.Equal("rbrray", PigLatin.Translate("brrr"));
 }
예제 #4
0
 public void TranslatesVowelWords()
 {
     Assert.Equal("applesyay", PigLatin.Translate("apples"));
     Assert.Equal("ofyay", PigLatin.Translate("of"));
 }
예제 #5
0
 public void TranslatesPhrases()
 {
     Assert.Equal("urplepay eoplepay eateryay", PigLatin.Translate("purple people eater"));
     Assert.Equal("irefay uckstray", PigLatin.Translate("fire trucks"));
 }