Beispiel #1
0
        public void TestFormatExceptions()
        {
            var main = new Interpreter.Sequence();

            for (int i = 0; i < formatTests.Length; ++i)
            {
                try
                {
                    main.Run(formatTests[i]);
                }
                catch (Exception e)
                {
                    Assert.AreEqual(formatResults[i], e.Message);
                }
            }
        }
Beispiel #2
0
        public void TestPermissionDeniedExceptions()
        {
            var main = new Interpreter.Sequence();

            for (int i = 0; i < constTests.Length; ++i)
            {
                try
                {
                    main.Run(constTests[i]);
                }
                catch (Exception e)
                {
                    Assert.AreEqual(constResult, e.Message);
                }
            }
        }
Beispiel #3
0
        public void TestDivideByZeroExceptions()
        {
            var main = new Interpreter.Sequence();

            for (int i = 0; i < overZeroTests.Length; ++i)
            {
                try
                {
                    main.Run(overZeroTests[i]);
                }
                catch (Exception e)
                {
                    Assert.AreEqual(overZeroResult, e.Message);
                }
            }
        }
Beispiel #4
0
        public void TestIndexOutOfBoundsExceptions()
        {
            var main = new Interpreter.Sequence();

            for (int i = 0; i < indexTests.Length; ++i)
            {
                try
                {
                    main.Run(indexTests[i]);
                }
                catch (Exception e)
                {
                    Assert.AreEqual(indexResults[i], e.Message);
                }
            }
        }