Example #1
0
        private void RunTestWithParse(string testName, string inputText, string expectedResult)
        {
            Symbol[] symbolList;
            string[] tokenList;

            ConverterEvening c = new ConverterEvening();

            c.Parse(inputText, out symbolList, out tokenList);

            string result = c.Convert(symbolList, tokenList);

            if (result == expectedResult)
            {
                listBox1.Items.Add(testName + " Success");
            }
            else
            {
                listBox1.Items.Add(testName + " Failed");
                listBox1.Items.Add("Result  :" + result);
                listBox1.Items.Add("Expected:" + expectedResult);
            }
        }
Example #2
0
        private void RunPass1TestWithParse(string testName, string inputText, string expectedResult)
        {
            Symbol[] symbolList;
            string[] tokenList;

            ConverterEvening c = new ConverterEvening();

            c.Parse(inputText, out symbolList, out tokenList);

            c.Pass1(symbolList, tokenList);

            //if (result == (expectedResult + "\r\n"))
            //{
            //   listBox1.Items.Add(testName + " Success");
            //}
            //else
            //{
            //   listBox1.Items.Add(testName + " Failed");
            //   listBox1.Items.Add("Result  :" + result);
            //   listBox1.Items.Add("Expected:" + expectedResult);
            //}
        }