public static GithibLottoPick GetInstance() { if (mInstance == null) { mInstance = new GithibLottoPick(); } return(mInstance); }
public static void Driver() { string[] possiblePicks = new string[] { "569815571556", "4938532894754", "1234567", "472844278465445" }; Console.WriteLine("Standard test cases"); foreach (string inputStr in possiblePicks) { List <String> lottoPick = GithibLottoPick.GetInstance().GetLottoPick(inputStr); if (lottoPick != null) { Console.WriteLine(inputStr + " -> " + string.Join(",", lottoPick)); } } string[] possiblePicks2 = new string[] { "101122241229", "1011222412209", "1011202241229", "1011222401229" }; Console.WriteLine("\nAdditional test cases, with 0"); foreach (string inputStr in possiblePicks2) { List <String> lottoPick = GithibLottoPick.GetInstance().GetLottoPick(inputStr); if (lottoPick != null) { Console.WriteLine(inputStr + " -> " + string.Join(",", lottoPick)); } } string[] possiblePicks3 = new string[] { "0101122241229", "10011222412209", "111222412290", "10012345", "12345607" }; Console.WriteLine("\nAdditional negative test cases, with 0"); foreach (string inputStr in possiblePicks3) { List <String> lottoPick = GithibLottoPick.GetInstance().GetLottoPick(inputStr); if (lottoPick != null) { Console.WriteLine(inputStr + " -> " + string.Join(",", lottoPick)); } } }