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:
committed by
Facebook Github Bot
parent
ff602d4606
commit
8a7183f465
@@ -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()
|
||||
{
|
||||
|
Reference in New Issue
Block a user