[csharp] Fix tests
This commit is contained in:
@@ -44,20 +44,20 @@ namespace Facebook.Yoga
|
|||||||
BorderRightWidth = 16,
|
BorderRightWidth = 16,
|
||||||
};
|
};
|
||||||
|
|
||||||
Assert.AreEqual(1.Px(), node.Top);
|
Assert.AreEqual(1.Pt(), node.Top);
|
||||||
Assert.AreEqual(2.Px(), node.Bottom);
|
Assert.AreEqual(2.Pt(), node.Bottom);
|
||||||
Assert.AreEqual(3.Px(), node.Left);
|
Assert.AreEqual(3.Pt(), node.Left);
|
||||||
Assert.AreEqual(4.Px(), node.Right);
|
Assert.AreEqual(4.Pt(), node.Right);
|
||||||
|
|
||||||
Assert.AreEqual(5.Px(), node.MarginTop);
|
Assert.AreEqual(5.Pt(), node.MarginTop);
|
||||||
Assert.AreEqual(6.Px(), node.MarginBottom);
|
Assert.AreEqual(6.Pt(), node.MarginBottom);
|
||||||
Assert.AreEqual(7.Px(), node.MarginLeft);
|
Assert.AreEqual(7.Pt(), node.MarginLeft);
|
||||||
Assert.AreEqual(8.Px(), node.MarginRight);
|
Assert.AreEqual(8.Pt(), node.MarginRight);
|
||||||
|
|
||||||
Assert.AreEqual(9.Px(), node.PaddingTop);
|
Assert.AreEqual(9.Pt(), node.PaddingTop);
|
||||||
Assert.AreEqual(10.Px(), node.PaddingBottom);
|
Assert.AreEqual(10.Pt(), node.PaddingBottom);
|
||||||
Assert.AreEqual(11.Px(), node.PaddingLeft);
|
Assert.AreEqual(11.Pt(), node.PaddingLeft);
|
||||||
Assert.AreEqual(12.Px(), node.PaddingRight);
|
Assert.AreEqual(12.Pt(), node.PaddingRight);
|
||||||
|
|
||||||
Assert.AreEqual(13, node.BorderTopWidth);
|
Assert.AreEqual(13, node.BorderTopWidth);
|
||||||
Assert.AreEqual(14, node.BorderBottomWidth);
|
Assert.AreEqual(14, node.BorderBottomWidth);
|
||||||
@@ -90,20 +90,20 @@ namespace Facebook.Yoga
|
|||||||
node.BorderLeftWidth = 15;
|
node.BorderLeftWidth = 15;
|
||||||
node.BorderRightWidth = 16;
|
node.BorderRightWidth = 16;
|
||||||
|
|
||||||
Assert.AreEqual(1.Px(), node.Top);
|
Assert.AreEqual(1.Pt(), node.Top);
|
||||||
Assert.AreEqual(2.Px(), node.Bottom);
|
Assert.AreEqual(2.Pt(), node.Bottom);
|
||||||
Assert.AreEqual(3.Px(), node.Left);
|
Assert.AreEqual(3.Pt(), node.Left);
|
||||||
Assert.AreEqual(4.Px(), node.Right);
|
Assert.AreEqual(4.Pt(), node.Right);
|
||||||
|
|
||||||
Assert.AreEqual(5.Px(), node.MarginTop);
|
Assert.AreEqual(5.Pt(), node.MarginTop);
|
||||||
Assert.AreEqual(6.Px(), node.MarginBottom);
|
Assert.AreEqual(6.Pt(), node.MarginBottom);
|
||||||
Assert.AreEqual(7.Px(), node.MarginLeft);
|
Assert.AreEqual(7.Pt(), node.MarginLeft);
|
||||||
Assert.AreEqual(8.Px(), node.MarginRight);
|
Assert.AreEqual(8.Pt(), node.MarginRight);
|
||||||
|
|
||||||
Assert.AreEqual(9.Px(), node.PaddingTop);
|
Assert.AreEqual(9.Pt(), node.PaddingTop);
|
||||||
Assert.AreEqual(10.Px(), node.PaddingBottom);
|
Assert.AreEqual(10.Pt(), node.PaddingBottom);
|
||||||
Assert.AreEqual(11.Px(), node.PaddingLeft);
|
Assert.AreEqual(11.Pt(), node.PaddingLeft);
|
||||||
Assert.AreEqual(12.Px(), node.PaddingRight);
|
Assert.AreEqual(12.Pt(), node.PaddingRight);
|
||||||
|
|
||||||
Assert.AreEqual(13, node.BorderTopWidth);
|
Assert.AreEqual(13, node.BorderTopWidth);
|
||||||
Assert.AreEqual(14, node.BorderBottomWidth);
|
Assert.AreEqual(14, node.BorderBottomWidth);
|
||||||
|
@@ -273,7 +273,7 @@ namespace Facebook.Yoga
|
|||||||
node1.MaxHeight = 100;
|
node1.MaxHeight = 100;
|
||||||
|
|
||||||
node0.CopyStyle(node1);
|
node0.CopyStyle(node1);
|
||||||
Assert.AreEqual(100.Px(), node0.MaxHeight);
|
Assert.AreEqual(100.Pt(), node0.MaxHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@@ -283,27 +283,27 @@ namespace Facebook.Yoga
|
|||||||
node0.MaxWidth = 80;
|
node0.MaxWidth = 80;
|
||||||
|
|
||||||
YogaNode node1 = new YogaNode(node0);
|
YogaNode node1 = new YogaNode(node0);
|
||||||
Assert.AreEqual(80.Px(), node1.MaxWidth);
|
Assert.AreEqual(80.Pt(), node1.MaxWidth);
|
||||||
|
|
||||||
YogaNode node2 = new YogaNode(node1)
|
YogaNode node2 = new YogaNode(node1)
|
||||||
{
|
{
|
||||||
MaxHeight = 90,
|
MaxHeight = 90,
|
||||||
};
|
};
|
||||||
Assert.AreEqual(80.Px(), node2.MaxWidth);
|
Assert.AreEqual(80.Pt(), node2.MaxWidth);
|
||||||
Assert.AreEqual(90.Px(), node2.MaxHeight);
|
Assert.AreEqual(90.Pt(), node2.MaxHeight);
|
||||||
|
|
||||||
YogaNode node3 = new YogaNode(node0)
|
YogaNode node3 = new YogaNode(node0)
|
||||||
{
|
{
|
||||||
MaxWidth = 100,
|
MaxWidth = 100,
|
||||||
};
|
};
|
||||||
Assert.AreEqual(100.Px(), node3.MaxWidth);
|
Assert.AreEqual(100.Pt(), node3.MaxWidth);
|
||||||
|
|
||||||
YogaNode node4 = new YogaNode(node2)
|
YogaNode node4 = new YogaNode(node2)
|
||||||
{
|
{
|
||||||
MaxWidth = 100,
|
MaxWidth = 100,
|
||||||
};
|
};
|
||||||
Assert.AreEqual(100.Px(), node4.MaxWidth);
|
Assert.AreEqual(100.Pt(), node4.MaxWidth);
|
||||||
Assert.AreEqual(90.Px(), node4.MaxHeight);
|
Assert.AreEqual(90.Pt(), node4.MaxHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ForceGC()
|
private void ForceGC()
|
||||||
|
Reference in New Issue
Block a user