AjTalk.Tests.Compilers.Vm.BytecodeCompilerTests.CompileBlockWithParameter C# (CSharp) Метод

CompileBlockWithParameter() приватный Метод

private CompileBlockWithParameter ( ) : void
Результат void
        public void CompileBlockWithParameter()
        {
            ModelParser parser = new ModelParser("[ :a | a doSomething ]");
            this.compiler.CompileExpression(parser.ParseExpression());

            Assert.IsNotNull(this.block);
            Assert.AreEqual(0, this.block.NoGlobalNames);
            Assert.AreEqual(0, this.block.NoLocals);
            Assert.AreEqual(1, this.block.NoConstants);
            Assert.IsNotNull(this.block.ByteCodes);
            Assert.AreEqual(2, this.block.ByteCodes.Length);
            Assert.AreEqual(0, this.block.Arity);

            object constant = this.block.GetConstant(0);

            Assert.IsNotNull(constant);
            Assert.IsInstanceOfType(constant, typeof(Block));

            var newblock = (Block)constant;
            Assert.AreEqual(0, newblock.NoGlobalNames);
            Assert.AreEqual(0, newblock.NoLocals);
            Assert.AreEqual(1, newblock.NoConstants);
            Assert.IsNotNull(newblock.ByteCodes);
            Assert.AreEqual(5, newblock.ByteCodes.Length);
            Assert.AreEqual(1, newblock.Arity);
        }