Move files around

This commit is contained in:
Rui Marinho
2016-12-16 14:09:39 +00:00
parent 57b042feb1
commit cb44a9f5a2
291 changed files with 25201 additions and 1724 deletions

View File

@@ -169,8 +169,8 @@ namespace Facebook.Yoga
return MeasureOutput.Make(123.4f, 81.7f);
});
node.CalculateLayout();
Assert.AreEqual(123, node.LayoutWidth);
Assert.AreEqual(81, node.LayoutHeight);
Assert.AreEqual(123.4f, node.LayoutWidth);
Assert.AreEqual(81.7f, node.LayoutHeight);
}
[Test]
@@ -212,7 +212,7 @@ namespace Facebook.Yoga
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");
Assert.AreEqual("{layout: {width: 100, height: 120, top: 0, left: 0}, flexDirection: 'column', alignItems: 'stretch', flexGrow: 0, flexShrink: 0, overflow: 'visible', width: 100px, height: 120px, children: [\n {layout: {width: 35, height: 45, top: 0, left: 0}, flexDirection: 'column', alignItems: 'stretch', flexGrow: 0, flexShrink: 0, overflow: 'visible', width: 35px, height: 45px, },\n {layout: {width: 30, height: 40, top: 45, left: 0}, flexDirection: 'column', alignItems: 'stretch', flexGrow: 0, flexShrink: 0, overflow: 'visible', width: 30px, height: 40px, },\n]},\n", parent.Print());
}
[Test]
@@ -225,10 +225,9 @@ namespace Facebook.Yoga
node1.MaxHeight = 100;
node0.CopyStyle(node1);
Assert.AreEqual(100, node0.MaxHeight);
Assert.AreEqual(100.Px(), node0.MaxHeight);
}
#if !UNITY_EDITOR
private void ForceGC()
{
GC.Collect(GC.MaxGeneration);
@@ -356,6 +355,22 @@ namespace Facebook.Yoga
return MeasureOutput.Make(120, 130);
});
}
#endif
[Test]
public void TestLayoutPadding() {
YogaNode node = new YogaNode();
node.Width = 100;
node.Height = 100;
node.SetPadding(YogaEdge.Start, 1);
node.SetPadding(YogaEdge.End, 2);
node.SetPadding(YogaEdge.Top, 3);
node.SetPadding(YogaEdge.Bottom, 4);
node.CalculateLayout();
Assert.AreEqual(1, node.GetLayoutPadding(YogaEdge.Left));
Assert.AreEqual(2, node.GetLayoutPadding(YogaEdge.Right));
Assert.AreEqual(3, node.GetLayoutPadding(YogaEdge.Top));
Assert.AreEqual(4, node.GetLayoutPadding(YogaEdge.Bottom));
}
}
}