public void ModeExpression3() { var e = new ModeExpression(new StringLiteral("xyz"), Modifier.Write); Assert.IsFalse(e.IsTrivial); Assert.AreEqual("Write \"xyz\"", e.ToString()); }
public void ModeExpression4() { var e = new ModeExpression(new StringLiteral("xyz"), Modifier.ReadClear); Assert.IsFalse(e.IsTrivial); Assert.AreEqual("ReadClear \"xyz\"", e.ToString()); }
public void ModeExpression9() { var e = new ModeExpression(new UserDefinedUnaryOperator("Property", new ThisExpression()), Modifier.WriteClear); Assert.IsFalse(e.IsTrivial); // This case looks a bit odd, but is actually correct. Written in UX, this would be "WriteClearProperty this", but this actually gets // parsed to the tree above. We could do some magic when printing the expression string, but it makes most sense with other cases // (such as "WriteClear this") to just always add the extra space between the mode and the ModeExpression's Expression, at the expense // of ModeExpression + UserDefinedUnaryOperator looking slightly different. Assert.AreEqual("WriteClear Property this", e.ToString()); }