Fix unit test

Summary: Fix #406 #407

Reviewed By: emilsjolander

Differential Revision: D4569680

fbshipit-source-id: a7b78674ed483d8619bd4aaa6e463203ef619c9b
This commit is contained in:
Kazuki Sakamoto
2017-02-16 07:26:41 -08:00
committed by Facebook Github Bot
parent ea8b7e0c91
commit 4d4db92a46
2 changed files with 32 additions and 32 deletions

View File

@@ -260,7 +260,7 @@ namespace Facebook.Yoga
parent.Insert(0, child0);
parent.Insert(0, child1);
parent.CalculateLayout();
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());
Assert.AreEqual("{layout: {width: 100, height: 120, top: 0, left: 0}, flexDirection: 'column', alignItems: 'stretch', flexGrow: 0, flexShrink: 0, flexBasis: 0%, overflow: 'visible', width: 100pt, height: 120pt, children: [\n {layout: {width: 35, height: 45, top: 0, left: 0}, flexDirection: 'column', alignItems: 'stretch', flexGrow: 0, flexShrink: 0, flexBasis: 0%, overflow: 'visible', width: 35pt, height: 45pt, },\n {layout: {width: 30, height: 40, top: 45, left: 0}, flexDirection: 'column', alignItems: 'stretch', flexGrow: 0, flexShrink: 0, flexBasis: 0%, overflow: 'visible', width: 30pt, height: 40pt, },\n]},\n", parent.Print());
}
[Test]
@@ -273,7 +273,7 @@ namespace Facebook.Yoga
node1.MaxHeight = 100;
node0.CopyStyle(node1);
Assert.AreEqual(100.Px(), node0.MaxHeight);
Assert.AreEqual(100.Pt(), node0.MaxHeight);
}
[Test]
@@ -283,27 +283,27 @@ namespace Facebook.Yoga
node0.MaxWidth = 80;
YogaNode node1 = new YogaNode(node0);
Assert.AreEqual(80.Px(), node1.MaxWidth);
Assert.AreEqual(80.Pt(), node1.MaxWidth);
YogaNode node2 = new YogaNode(node1)
{
MaxHeight = 90,
};
Assert.AreEqual(80.Px(), node2.MaxWidth);
Assert.AreEqual(90.Px(), node2.MaxHeight);
Assert.AreEqual(80.Pt(), node2.MaxWidth);
Assert.AreEqual(90.Pt(), node2.MaxHeight);
YogaNode node3 = new YogaNode(node0)
{
MaxWidth = 100,
};
Assert.AreEqual(100.Px(), node3.MaxWidth);
Assert.AreEqual(100.Pt(), node3.MaxWidth);
YogaNode node4 = new YogaNode(node2)
{
MaxWidth = 100,
};
Assert.AreEqual(100.Px(), node4.MaxWidth);
Assert.AreEqual(90.Px(), node4.MaxHeight);
Assert.AreEqual(100.Pt(), node4.MaxWidth);
Assert.AreEqual(90.Pt(), node4.MaxHeight);
}
private void ForceGC()