Exemple #1
0
        public static void TestReturnsZeroWhenEmptyString()
        {
            string testName = MethodBase.GetCurrentMethod().Name;
            try
            {
                SimpleParser p = new SimpleParser();
                int result = p.ParseAndSum(string.Empty);
                if(result!=0)
                {
            //Calling the helper method
                    TestUtil.ShowProblem(testName, 
"Parse and sum should have returned 0 on an empty string");
                }
            }
            catch (Exception e)
            {
                TestUtil.ShowProblem(testName, e.ToString());
            }
        }
Exemple #2
0
        public static void TestReturnsZeroWhenEmptyString()
        {
            try
            {
                SimpleParser p      = new SimpleParser();
                int          result = p.ParseAndSum(string.Empty);
                if (result != 0)
                {
                    Console.WriteLine(
                        @"***SimpleParserTests.TestReturnsZeroWhenEmptyString: 
-------
Parse and sum should have returned 0 on an empty string");
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
        public static void TestReturnsZeroWhenEmptyString()
        {
            var testName = MethodBase.GetCurrentMethod().Name;

            try
            {
                var p      = new SimpleParser();
                var result = p.ParseAndSum(string.Empty);
                if (result != 0)
                {
                    TestUtil.ShowProblem(testName,
                                         "Parse and sum should have returned 0 on an empty string");
                }
            }
            catch (Exception e)
            {
                TestUtil.ShowProblem(testName, e.ToString());
            }
        }
Exemple #4
0
        public static void TestReturnsZeroWhenEmptyString()
        {
            try
            {
                SimpleParser p = new SimpleParser();
                int result = p.ParseAndSum(string.Empty);
                if (result != 0)
                {

                    Console.WriteLine(
                        @"***SimpleParserTests.TestReturnsZeroWhenEmptyString: 
-------
Parse and sum should have returned 0 on an empty string");
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }