Пример #1
0
        public void Should_Create_Function_Returning_Value()
        {
            var dm = new NPCompiler().CompileMethod("funcao inteiro soma() retorne 8 + 2 fim");

            var result = dm.Invoke(null, null);

            Assert.AreEqual(10, result);
        }
Пример #2
0
        public void Should_Create_Function_Returning_Value()
        {
            var dm = new NPCompiler().CompileMethod("funcao inteiro soma(inteiro a, inteiro b) retorne 1 fim");

            var result = dm.Invoke(null, new object[] { 1, 1 });

            Assert.AreEqual(1, result);
        }
Пример #3
0
        public void Hello()
        {
            var method = @"funcao inteiro soma() retorne 1 + 1 fim";

            var dm = new NPCompiler().CompileMethod(method);

            var result = dm.Invoke(null, null);

            Assert.AreEqual(2, (int)result);
        }