Esempio n. 1
0
        public void FinalEmptyIsTest1()
        {
            IPM pm = new PM("solution.right ");

            Assert.True(pm.FinalEmptyIs(1, LevelType.Property, "right"));
            Assert.True(pm.FinalEmptyIs(2, LevelType.RightOperandEmpty));
        }
Esempio n. 2
0
        public void FinalEmptyIsTest2()
        {
            Assert.Throws <NotSupportedOperationException>(() =>
            {
                IPM pm = new PM("solution.right = ");
                Assert.True(pm.FinalEmptyIs(1, LevelType.Property, "right"));
            });

            Assert.Throws <NotSupportedOperationException>(() =>
            {
                IPM pm = new PM("solution.right : ");
                Assert.True(pm.FinalEmptyIs(1, LevelType.Property, "right"));
            });

            Assert.Throws <NotSupportedOperationException>(() =>
            {
                IPM pm = new PM("solution.right . prop");
                Assert.True(pm.FinalEmptyIs(1, LevelType.Property, "right"));
            });

            Assert.Throws <NotSupportedOperationException>(() =>
            {
                IPM pm = new PM("solution.right mixed data");
                Assert.True(pm.FinalEmptyIs(1, LevelType.Property, "right"));
            });
        }
Esempio n. 3
0
        public void FinalEmptyIsTest5()
        {
            IPM pm = new PM("left.solution(\"m(1)\", \"m()\", ')', \")\", \"(\")");

            Assert.True(pm.Is(0, LevelType.Property, "left"));
            Assert.True(pm.FinalEmptyIs(1, LevelType.Method, "solution"));
        }
Esempio n. 4
0
        public void FinalEmptyIsTest4()
        {
            IPM pm = new PM("left.solution(\"test m()\")");

            Assert.AreEqual(pm.Is(0, LevelType.Property, "left"), true);
            Assert.AreEqual(pm.FinalEmptyIs(1, LevelType.Method, "solution"), true);
        }
Esempio n. 5
0
        public void FinalEmptyIsTest2()
        {
            try {
                IPM pm = new PM("solution.right = ");
                Assert.AreEqual(pm.FinalEmptyIs(1, LevelType.Property, "right"), true);
                Assert.Fail("1");
            }
            catch (Exception ex) { Assert.IsTrue(ex.GetType() == typeof(NotSupportedOperationException), ex.GetType().ToString()); }

            try {
                IPM pm = new PM("solution.right : ");
                Assert.AreEqual(pm.FinalEmptyIs(1, LevelType.Property, "right"), true);
                Assert.Fail("2");
            }
            catch (Exception ex) { Assert.IsTrue(ex.GetType() == typeof(NotSupportedOperationException), ex.GetType().ToString()); }

            try {
                IPM pm = new PM("solution.right . prop");
                Assert.AreEqual(pm.FinalEmptyIs(1, LevelType.Property, "right"), true);
                Assert.Fail("3");
            }
            catch (Exception ex) { Assert.IsTrue(ex.GetType() == typeof(NotSupportedOperationException), ex.GetType().ToString()); }

            try {
                IPM pm = new PM("solution.right mixed data");
                Assert.AreEqual(pm.FinalEmptyIs(1, LevelType.Property, "right"), true);
                Assert.Fail("4");
            }
            catch (Exception ex) { Assert.IsTrue(ex.GetType() == typeof(NotSupportedOperationException), ex.GetType().ToString()); }
        }
Esempio n. 6
0
        public void FinalEmptyIsTest3()
        {
            IPM pm = new PM("left.solution.right");

            Assert.False(pm.Is(0, LevelType.Property, "right"));
            Assert.False(pm.FinalEmptyIs(1, LevelType.Property, "right"));
            Assert.True(pm.Is(2, LevelType.Property, "right"));
        }
Esempio n. 7
0
        public void FinalEmptyIsTest3()
        {
            IPM pm = new PM("left.solution.right");

            Assert.AreEqual(pm.Is(0, LevelType.Property, "right"), false);
            Assert.AreEqual(pm.FinalEmptyIs(1, LevelType.Property, "right"), false);
            Assert.AreEqual(pm.Is(2, LevelType.Property, "right"), true);
        }