Exemple #1
0
        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();
        }
Exemple #2
0
        public void TestCases(int number, bool expectedHappyness)
        {
            var isHappy = new HappyNumbersImpl().IsHappy(number);

            Assert.Equal(isHappy, expectedHappyness);
        }