Пример #1
0
        public void ModeExpression3()
        {
            var e = new ModeExpression(new StringLiteral("xyz"), Modifier.Write);

            Assert.IsFalse(e.IsTrivial);
            Assert.AreEqual("Write \"xyz\"", e.ToString());
        }
Пример #2
0
        public void ModeExpression4()
        {
            var e = new ModeExpression(new StringLiteral("xyz"), Modifier.ReadClear);

            Assert.IsFalse(e.IsTrivial);
            Assert.AreEqual("ReadClear \"xyz\"", e.ToString());
        }
Пример #3
0
        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());
        }