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); }
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); }
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); }
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()); } }
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); } }