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

CompileSimpleClassWithSimpleSetMethod() private method

private CompileSimpleClassWithSimpleSetMethod ( ) : void
return void
        public void CompileSimpleClassWithSimpleSetMethod()
        {
            ClassModel @class = new ClassModel("AClass", (ClassModel)null, new List<string>() { "x", "y" }, new List<string>(), false, null, null);
            ModelParser parser = new ModelParser("x: newX x := newX");
            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(newX)"));
            Assert.IsTrue(ContainsLine(output, "{"));
            Assert.IsTrue(ContainsLine(output, "var self = this;"));
            Assert.IsTrue(ContainsLine(output, "self.$x = newX;"));
            Assert.IsTrue(ContainsLine(output, "};"));
        }