AjTalk.Tests.Compilers.Javascript.CompilerTests.CompileSimpleClassWithSimpleMethod C# (CSharp) Method

CompileSimpleClassWithSimpleMethod() private method

private CompileSimpleClassWithSimpleMethod ( ) : void
return void
        public void CompileSimpleClassWithSimpleMethod()
        {
            ClassModel @class = new ClassModel("AClass", (ClassModel)null, new List<string>() { "x", "y" }, new List<string>(), false, null, null);
            ModelParser parser = new ModelParser("x ^x");
            MethodModel method = parser.ParseMethod(@class, false);
            @class.InstanceMethods.Add(method);
            this.compiler.CompileClass(@class);
            this.writer.Close();
            string output = this.writer.ToString();
            Assert.IsTrue(ContainsLine(output, "function AClass()"));
            Assert.IsTrue(ContainsLine(output, "{"));
            Assert.IsTrue(ContainsLine(output, "}"));
            Assert.IsTrue(ContainsLine(output, "AClass.prototype.$x = null;"));
            Assert.IsTrue(ContainsLine(output, "AClass.prototype.$y = null;"));
            Assert.IsTrue(ContainsLine(output, "AClass.prototype['x'] = function()"));
            Assert.IsTrue(ContainsLine(output, "{"));
            Assert.IsTrue(ContainsLine(output, "return self.$x;"));
            Assert.IsTrue(ContainsLine(output, "};"));
        }