public void TestPrint() { YogaNode parent = new YogaNode(); parent.Width = 100; parent.Height = 120; YogaNode child0 = new YogaNode(); child0.Width = 30; child0.Height = 40; YogaNode child1 = new YogaNode(); child1.Width = 35; child1.Height = 45; parent.Insert(0, child0); parent.Insert(0, child1); parent.CalculateLayout(); Assert.AreEqual(parent.Print(), "{layout: {width: 100, height: 120, top: 0, left: 0}, flexDirection: 'column', alignItems: 'stretch', flexGrow: 0, flexShrink: 0, overflow: 'visible', width: 100, height: 120, children: [\n {layout: {width: 35, height: 45, top: 0, left: 0}, flexDirection: 'column', alignItems: 'stretch', flexGrow: 0, flexShrink: 0, overflow: 'visible', width: 35, height: 45, },\n {layout: {width: 30, height: 40, top: 45, left: 0}, flexDirection: 'column', alignItems: 'stretch', flexGrow: 0, flexShrink: 0, overflow: 'visible', width: 30, height: 40, },\n]},\n"); }
public void TestPrint() { YogaNode parent = new YogaNode(); parent.Width = 100; parent.Height = 120; YogaNode child0 = new YogaNode(); child0.Width = 30; child0.Height = 40; YogaNode child1 = new YogaNode(); child1.Width = 35; child1.Height = 45; parent.Insert(0, child0); parent.Insert(0, child1); parent.CalculateLayout(); Assert.AreEqual("<div layout=\"width: 100; height: 120; top: 0; left: 0;\" style=\"width: 100px; height: 120px; \" >\n <div layout=\"width: 35; height: 45; top: 0; left: 0;\" style=\"width: 35px; height: 45px; \" ></div>\n <div layout=\"width: 30; height: 40; top: 45; left: 0;\" style=\"width: 30px; height: 40px; \" ></div>\n</div>", parent.Print()); }
public void TestPrintWithLogger() { YogaNode node = new YogaNode(); node.Width = 110; node.Height = 105; node.CalculateLayout(); Assert.AreEqual("<div layout=\"width: 110; height: 105; top: 0; left: 0;\" style=\"width: 110px; height: 105px; \" ></div>", node.Print()); }