Add tests for SetMeasureFunction

Summary: Add tests for checking C side asserts in managed

Reviewed By: emilsjolander

Differential Revision: D4154869

fbshipit-source-id: 5203db27eff963d46f188de448f607a24ed63fab
This commit is contained in:
Kazuki Sakamoto
2016-11-09 13:17:44 -08:00
committed by Facebook Github Bot
parent ff602d4606
commit 8a7183f465

View File

@@ -161,6 +161,30 @@ namespace Facebook.CSSLayout
Assert.AreEqual(150, (int)node.LayoutHeight);
}
[Test]
[ExpectedException("System.InvalidOperationException")]
public void TestChildWithMeasureFunc()
{
CSSNode node = new CSSNode();
node.SetMeasureFunction((_, width, widthMode, height, heightMode) => {
return MeasureOutput.Make(100, 150);
});
CSSNode child = new CSSNode();
node.Insert(0, child);
}
[Test]
[ExpectedException("System.InvalidOperationException")]
public void TestMeasureFuncWithChild()
{
CSSNode node = new CSSNode();
CSSNode child = new CSSNode();
node.Insert(0, child);
node.SetMeasureFunction((_, width, widthMode, height, heightMode) => {
return MeasureOutput.Make(100, 150);
});
}
[Test]
public void TestPrint()
{