| 18 | } |
| 19 | |
| 20 | TEST(ViewNode, canInsertChildren) { |
| 21 | ViewNodeTestsDependencies utils; |
| 22 | |
| 23 | auto root = utils.createLayout(); |
| 24 | auto child = utils.createLayout(); |
| 25 | auto child2 = utils.createLayout(); |
| 26 | |
| 27 | root->insertChildAt(utils.getViewTransactionScope(), child, 0); |
| 28 | root->insertChildAt(utils.getViewTransactionScope(), child2, 1); |
| 29 | |
| 30 | ASSERT_EQ(static_cast<size_t>(2), root->getChildCount()); |
| 31 | |
| 32 | ASSERT_EQ(child.get(), root->getChildAt(0)); |
| 33 | ASSERT_EQ(child2.get(), root->getChildAt(1)); |
| 34 | |
| 35 | ASSERT_EQ(2, static_cast<int>(YGNodeGetChildCount(root->getYogaNode()))); |
| 36 | ASSERT_EQ(child->getYogaNode(), YGNodeGetChild(root->getYogaNode(), 0)); |
| 37 | ASSERT_EQ(child2->getYogaNode(), YGNodeGetChild(root->getYogaNode(), 1)); |
| 38 | } |
| 39 | |
| 40 | TEST(ViewNode, canRemoveChildren) { |
| 41 | ViewNodeTestsDependencies utils; |
nothing calls this directly
no test coverage detected