Exemple #1
0
        public void RootCallThisMethodTest()
        {
            var param = new This();
            var f     = _compiler.NewLambda()
                        .WithThis <This>()
                        .Returns <string>()
                        .Compile("CurrentUser");

            f(param).ShouldEqual("user");
        }
Exemple #2
0
        public void TypeCallTest()
        {
            var param = new This {
                CurrentUserProperty = "michael"
            };
            var f = _compiler.NewLambda()
                    .WithThis <This>()
                    .Returns <int>()
                    .Compile("CurrentUserProperty.Length");

            f(param).ShouldEqual(7);
        }
Exemple #3
0
        public void RootCallThisPropertyTest()
        {
            var param = new This {
                CurrentUserProperty = "michael"
            };
            var f = _compiler.NewLambda()
                    .WithThis <This>()
                    .Returns <string>()
                    .Compile("CurrentUserProperty");

            f(param).ShouldEqual("michael");
        }