static void Main(string[] args) { SimpleParser p = new SimpleParser(); int parsed = p.ParseAndSum("4"); Console.WriteLine(parsed); try { SimpleParserTests.TestReturnsZeroWhenEmptyString(); } catch (Exception e) { Console.WriteLine(e); } Console.ReadKey(); }
public static void TestReturnsZeroWhenEmptyString() { try { SimpleParser p = new SimpleParser(); int result = p.ParseAndSum(string.Empty); if (result != 0) { Console.WriteLine( @"***SimpleParserTests.TestReturnsZeroWhenEmptyString: ------- Metoda ParseAndSum powinna zwrócić 0 w przypadku przekazania pustego ciągu znaków "); } } catch (Exception e) { Console.WriteLine(e); } }