public static void Main(string[] args) { Console.WriteLine("Please enter the number to check"); var numberString = Console.ReadLine() ?? string.Empty; var number = int.Parse(numberString); var happy = new HappyNumbersImpl().IsHappy(number); Console.WriteLine($"Happy? {happy}"); Console.ReadLine(); }
public void TestCases(int number, bool expectedHappyness) { var isHappy = new HappyNumbersImpl().IsHappy(number); Assert.Equal(isHappy, expectedHappyness); }