private static void Main() { while (true) { char sign; Console.Write("Enter a line: "); var strOfConsole = Console.ReadLine(); var firstSign = new GetFirstSign.GetFirstSign(); try { sign = firstSign.GetSign(strOfConsole); } catch (ArgumentException) { Console.WriteLine("Your line is null or empty!"); continue; } Console.WriteLine($"First sign is: {sign}"); } }
public char ShowSignWithoutExc(string source) { var firstSign = new GetFirstSign.GetFirstSign(); return(firstSign.GetSign(source)); }
public void ShowSignOfEmptyLine() { var firstSign = new GetFirstSign.GetFirstSign(); Assert.Throws <ArgumentException>(() => firstSign.GetSign("")); }