I want to create unit test for user input, anyone who can help me please do share the information with me if you can, thanks mates or examples to do this as i never used them before for console app in user input for number less than 5 and its output for that number.
-
-
- using System;
-
- public class UserApp
- {
- public static void Main()
- {
- string[] seperators = {",", " ", ";", "."};
- int num2;
- Console.WriteLine("Input numbers over 10:");
-
- string[] splitArray = Console.ReadLine().Split(seperators, StringSplitOptions.RemoveEmptyEntries);
- foreach (string num in splitArray)
- {
-
- if(Int32.TryParse(num, out num2) == true)
- {
- if (num2 < 10)
- {
- Console.WriteLine(num + " is smaller than 10");
- }
- }
- else
- {
- Console.WriteLine(num + " is not a number...");
- }
- }
- }
-
- }