diff --git a/csharp/tests/Facebook.CSSLayout/CSSNodeTest.cs b/csharp/tests/Facebook.CSSLayout/CSSNodeTest.cs index f46ef24d..badf4639 100644 --- a/csharp/tests/Facebook.CSSLayout/CSSNodeTest.cs +++ b/csharp/tests/Facebook.CSSLayout/CSSNodeTest.cs @@ -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() {