Пример #1
0
 public void FinalIsTest5()
 {
     IPM pm = new PM("left.solution(\" (a, b) \").right");
     Assert.AreEqual(pm.Is(0, LevelType.Property, "left"), true);
     Assert.AreEqual(pm.Is(1, LevelType.Method, "solution"), true);
     Assert.AreEqual(pm.FinalIs(2, LevelType.Property, "right"), true);
 }
Пример #2
0
 public void FinalIsTest3()
 {
     IPM pm = new PM("left.solution.right");
     Assert.AreEqual(pm.Is(0, LevelType.Property, "right"), false);
     Assert.AreEqual(pm.FinalIs(1, LevelType.Property, "right"), false);
     Assert.AreEqual(pm.Is(2, LevelType.Property, "right"), true);
 }
Пример #3
0
 public void FinalIsTest1()
 {
     IPM pm = new PM("left.solution.right");
     Assert.AreEqual(pm.Levels.Count, 4);
     Assert.AreEqual(pm.FinalIs(2, LevelType.Property, "right"), true);
     Assert.AreEqual(pm.FinalIs(3, LevelType.RightOperandEmpty), true);
 }
Пример #4
0
        public void FinalIsTest2()
        {
            try {
                IPM pm = new PM("left.solution.right");
                Assert.AreEqual(pm.FinalIs(1, LevelType.Property, "solution"), true);
                Assert.Fail("1");
            }
            catch(Exception ex) { Assert.IsTrue(ex.GetType() == typeof(NotSupportedOperationException), ex.GetType().ToString()); }

            try {
                IPM pm = new PM("left.solution.right");
                Assert.AreEqual(pm.FinalIs(LevelType.Property, "left"), true);
                Assert.Fail("2");
            }
            catch(Exception ex) { Assert.IsTrue(ex.GetType() == typeof(NotSupportedOperationException), ex.GetType().ToString()); }
        }
Пример #5
0
        public void FinalIsTest2()
        {
            try {
                IPM pm = new PM("left.solution.right");
                Assert.AreEqual(pm.FinalIs(1, LevelType.Property, "solution"), true);
                Assert.Fail("1");
            }
            catch(NotSupportedOperationException) {
                Assert.IsTrue(true);
            }

            try {
                IPM pm = new PM("left.solution.right");
                Assert.AreEqual(pm.FinalIs(0, LevelType.Property, "left"), true);
                Assert.Fail("2");
            }
            catch(NotSupportedOperationException) {
                Assert.IsTrue(true);
            }
        }