Beispiel #1
0
        public void IfFalse()
        {
            var method = CreateMethod(block => block.If(false, EmitAst.Return("foo"), EmitAst.Return("bar")));
            var result = (string)method.Invoke(null, null);

            Assert.AreEqual("bar", result);
        }
Beispiel #2
0
        public void IfOnlyTrue()
        {
            var method = CreateMethod(block =>
            {
                block.If(true, EmitAst.Return("foo"));
                block.Return("bar");
            });
            var result = (string)method.Invoke(null, null);

            Assert.AreEqual("foo", result);
        }