Пример #1
0
        public void EmitInstantiation_should_generate()
        {
            var    manager = new ExpressionSerializationManager();
            var    output  = new StringWriter();
            string name;

            using (manager.CreateSession()) {
                name = CodeUtility.EmitInstantiation(manager, output, new A());
            }

            // TODO Empty statement and extra ws are generated
            Assert.Equal("a1", name);
            Assert.Equal(
                @"Carbonfrost.UnitTests.Hxl.A a1;
Carbonfrost.UnitTests.Hxl.B b1;
a1 = new Carbonfrost.UnitTests.Hxl.A();
a1.B = b1 = new Carbonfrost.UnitTests.Hxl.B();
b1.C = 420;
b1.D = true;
;

", output.ToString());
        }
Пример #2
0
 protected override void VisitDocument(DomDocument document)
 {
     using (manager.CreateSession()) {
         DoChildVisit(document, "this.__document");
     }
 }