rename csharp code
Summary: new name Reviewed By: splhack Differential Revision: D4247106 fbshipit-source-id: 6e1097de104f3a011c78ae65b33e57865b007711
This commit is contained in:
committed by
Facebook Github Bot
parent
4bbf35832e
commit
f7cc614d67
@@ -12,7 +12,7 @@
|
||||
using System;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace Facebook.CSSLayout
|
||||
namespace Facebook.Yoga
|
||||
{
|
||||
[TestFixture]
|
||||
public class CSSLayoutAbsolutePositionTest
|
||||
@@ -20,11 +20,11 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_absolute_layout_width_height_start_top()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.PositionType = YogaPositionType.Absolute;
|
||||
root_child0.SetPosition(YogaEdge.Start, 10f);
|
||||
root_child0.SetPosition(YogaEdge.Top, 10f);
|
||||
@@ -61,11 +61,11 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_absolute_layout_width_height_end_bottom()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.PositionType = YogaPositionType.Absolute;
|
||||
root_child0.SetPosition(YogaEdge.End, 10f);
|
||||
root_child0.SetPosition(YogaEdge.Bottom, 10f);
|
||||
@@ -102,11 +102,11 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_absolute_layout_start_top_end_bottom()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.PositionType = YogaPositionType.Absolute;
|
||||
root_child0.SetPosition(YogaEdge.Start, 10f);
|
||||
root_child0.SetPosition(YogaEdge.Top, 10f);
|
||||
@@ -143,11 +143,11 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_absolute_layout_width_height_start_top_end_bottom()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.PositionType = YogaPositionType.Absolute;
|
||||
root_child0.SetPosition(YogaEdge.Start, 10f);
|
||||
root_child0.SetPosition(YogaEdge.Top, 10f);
|
||||
@@ -186,19 +186,19 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_do_not_clamp_height_of_absolute_node_to_height_of_its_overflow_hidden_parent()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.FlexDirection = YogaFlexDirection.Row;
|
||||
root.Overflow = YogaOverflow.Hidden;
|
||||
root.Width = 50f;
|
||||
root.Height = 50f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.PositionType = YogaPositionType.Absolute;
|
||||
root_child0.SetPosition(YogaEdge.Start, 0f);
|
||||
root_child0.SetPosition(YogaEdge.Top, 0f);
|
||||
root.Insert(0, root_child0);
|
||||
|
||||
CSSNode root_child0_child0 = new CSSNode();
|
||||
YogaNode root_child0_child0 = new YogaNode();
|
||||
root_child0_child0.Width = 100f;
|
||||
root_child0_child0.Height = 100f;
|
||||
root_child0.Insert(0, root_child0_child0);
|
||||
@@ -242,7 +242,7 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_absolute_layout_within_border()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.SetMargin(YogaEdge.Left, 10f);
|
||||
root.SetMargin(YogaEdge.Top, 10f);
|
||||
root.SetMargin(YogaEdge.Right, 10f);
|
||||
@@ -258,7 +258,7 @@ namespace Facebook.CSSLayout
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.PositionType = YogaPositionType.Absolute;
|
||||
root_child0.SetPosition(YogaEdge.Left, 0f);
|
||||
root_child0.SetPosition(YogaEdge.Top, 0f);
|
||||
@@ -266,7 +266,7 @@ namespace Facebook.CSSLayout
|
||||
root_child0.Height = 50f;
|
||||
root.Insert(0, root_child0);
|
||||
|
||||
CSSNode root_child1 = new CSSNode();
|
||||
YogaNode root_child1 = new YogaNode();
|
||||
root_child1.PositionType = YogaPositionType.Absolute;
|
||||
root_child1.SetPosition(YogaEdge.Right, 0f);
|
||||
root_child1.SetPosition(YogaEdge.Bottom, 0f);
|
@@ -12,7 +12,7 @@
|
||||
using System;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace Facebook.CSSLayout
|
||||
namespace Facebook.Yoga
|
||||
{
|
||||
[TestFixture]
|
||||
public class CSSLayoutAlignContentTest
|
||||
@@ -20,32 +20,32 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_align_content_flex_start()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.Wrap = YogaWrap.Wrap;
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.Width = 50f;
|
||||
root_child0.Height = 10f;
|
||||
root.Insert(0, root_child0);
|
||||
|
||||
CSSNode root_child1 = new CSSNode();
|
||||
YogaNode root_child1 = new YogaNode();
|
||||
root_child1.Width = 50f;
|
||||
root_child1.Height = 10f;
|
||||
root.Insert(1, root_child1);
|
||||
|
||||
CSSNode root_child2 = new CSSNode();
|
||||
YogaNode root_child2 = new YogaNode();
|
||||
root_child2.Width = 50f;
|
||||
root_child2.Height = 10f;
|
||||
root.Insert(2, root_child2);
|
||||
|
||||
CSSNode root_child3 = new CSSNode();
|
||||
YogaNode root_child3 = new YogaNode();
|
||||
root_child3.Width = 50f;
|
||||
root_child3.Height = 10f;
|
||||
root.Insert(3, root_child3);
|
||||
|
||||
CSSNode root_child4 = new CSSNode();
|
||||
YogaNode root_child4 = new YogaNode();
|
||||
root_child4.Width = 50f;
|
||||
root_child4.Height = 10f;
|
||||
root.Insert(4, root_child4);
|
||||
@@ -119,33 +119,33 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_align_content_flex_end()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.AlignContent = YogaAlign.FlexEnd;
|
||||
root.Wrap = YogaWrap.Wrap;
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.Width = 50f;
|
||||
root_child0.Height = 10f;
|
||||
root.Insert(0, root_child0);
|
||||
|
||||
CSSNode root_child1 = new CSSNode();
|
||||
YogaNode root_child1 = new YogaNode();
|
||||
root_child1.Width = 50f;
|
||||
root_child1.Height = 10f;
|
||||
root.Insert(1, root_child1);
|
||||
|
||||
CSSNode root_child2 = new CSSNode();
|
||||
YogaNode root_child2 = new YogaNode();
|
||||
root_child2.Width = 50f;
|
||||
root_child2.Height = 10f;
|
||||
root.Insert(2, root_child2);
|
||||
|
||||
CSSNode root_child3 = new CSSNode();
|
||||
YogaNode root_child3 = new YogaNode();
|
||||
root_child3.Width = 50f;
|
||||
root_child3.Height = 10f;
|
||||
root.Insert(3, root_child3);
|
||||
|
||||
CSSNode root_child4 = new CSSNode();
|
||||
YogaNode root_child4 = new YogaNode();
|
||||
root_child4.Width = 50f;
|
||||
root_child4.Height = 10f;
|
||||
root.Insert(4, root_child4);
|
||||
@@ -219,33 +219,33 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_align_content_center()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.AlignContent = YogaAlign.Center;
|
||||
root.Wrap = YogaWrap.Wrap;
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.Width = 50f;
|
||||
root_child0.Height = 10f;
|
||||
root.Insert(0, root_child0);
|
||||
|
||||
CSSNode root_child1 = new CSSNode();
|
||||
YogaNode root_child1 = new YogaNode();
|
||||
root_child1.Width = 50f;
|
||||
root_child1.Height = 10f;
|
||||
root.Insert(1, root_child1);
|
||||
|
||||
CSSNode root_child2 = new CSSNode();
|
||||
YogaNode root_child2 = new YogaNode();
|
||||
root_child2.Width = 50f;
|
||||
root_child2.Height = 10f;
|
||||
root.Insert(2, root_child2);
|
||||
|
||||
CSSNode root_child3 = new CSSNode();
|
||||
YogaNode root_child3 = new YogaNode();
|
||||
root_child3.Width = 50f;
|
||||
root_child3.Height = 10f;
|
||||
root.Insert(3, root_child3);
|
||||
|
||||
CSSNode root_child4 = new CSSNode();
|
||||
YogaNode root_child4 = new YogaNode();
|
||||
root_child4.Width = 50f;
|
||||
root_child4.Height = 10f;
|
||||
root.Insert(4, root_child4);
|
||||
@@ -319,29 +319,29 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_align_content_stretch()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.AlignContent = YogaAlign.Stretch;
|
||||
root.Wrap = YogaWrap.Wrap;
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.Width = 50f;
|
||||
root.Insert(0, root_child0);
|
||||
|
||||
CSSNode root_child1 = new CSSNode();
|
||||
YogaNode root_child1 = new YogaNode();
|
||||
root_child1.Width = 50f;
|
||||
root.Insert(1, root_child1);
|
||||
|
||||
CSSNode root_child2 = new CSSNode();
|
||||
YogaNode root_child2 = new YogaNode();
|
||||
root_child2.Width = 50f;
|
||||
root.Insert(2, root_child2);
|
||||
|
||||
CSSNode root_child3 = new CSSNode();
|
||||
YogaNode root_child3 = new YogaNode();
|
||||
root_child3.Width = 50f;
|
||||
root.Insert(3, root_child3);
|
||||
|
||||
CSSNode root_child4 = new CSSNode();
|
||||
YogaNode root_child4 = new YogaNode();
|
||||
root_child4.Width = 50f;
|
||||
root.Insert(4, root_child4);
|
||||
root.StyleDirection = YogaDirection.LTR;
|
@@ -12,7 +12,7 @@
|
||||
using System;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace Facebook.CSSLayout
|
||||
namespace Facebook.Yoga
|
||||
{
|
||||
[TestFixture]
|
||||
public class CSSLayoutAlignItemsTest
|
||||
@@ -20,11 +20,11 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_align_items_stretch()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.Height = 10f;
|
||||
root.Insert(0, root_child0);
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
@@ -57,12 +57,12 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_align_items_center()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.AlignItems = YogaAlign.Center;
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.Width = 10f;
|
||||
root_child0.Height = 10f;
|
||||
root.Insert(0, root_child0);
|
||||
@@ -96,12 +96,12 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_align_items_flex_start()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.AlignItems = YogaAlign.FlexStart;
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.Width = 10f;
|
||||
root_child0.Height = 10f;
|
||||
root.Insert(0, root_child0);
|
||||
@@ -135,12 +135,12 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_align_items_flex_end()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.AlignItems = YogaAlign.FlexEnd;
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.Width = 10f;
|
||||
root_child0.Height = 10f;
|
||||
root.Insert(0, root_child0);
|
@@ -12,7 +12,7 @@
|
||||
using System;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace Facebook.CSSLayout
|
||||
namespace Facebook.Yoga
|
||||
{
|
||||
[TestFixture]
|
||||
public class CSSLayoutAlignSelfTest
|
||||
@@ -20,11 +20,11 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_align_self_center()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.AlignSelf = YogaAlign.Center;
|
||||
root_child0.Width = 10f;
|
||||
root_child0.Height = 10f;
|
||||
@@ -59,11 +59,11 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_align_self_flex_end()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.AlignSelf = YogaAlign.FlexEnd;
|
||||
root_child0.Width = 10f;
|
||||
root_child0.Height = 10f;
|
||||
@@ -98,11 +98,11 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_align_self_flex_start()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.AlignSelf = YogaAlign.FlexStart;
|
||||
root_child0.Width = 10f;
|
||||
root_child0.Height = 10f;
|
||||
@@ -137,12 +137,12 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_align_self_flex_end_override_flex_start()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.AlignItems = YogaAlign.FlexStart;
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.AlignSelf = YogaAlign.FlexEnd;
|
||||
root_child0.Width = 10f;
|
||||
root_child0.Height = 10f;
|
@@ -12,7 +12,7 @@
|
||||
using System;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace Facebook.CSSLayout
|
||||
namespace Facebook.Yoga
|
||||
{
|
||||
[TestFixture]
|
||||
public class CSSLayoutBorderTest
|
||||
@@ -20,7 +20,7 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_border_no_size()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.SetBorder(YogaEdge.Left, 10f);
|
||||
root.SetBorder(YogaEdge.Top, 10f);
|
||||
root.SetBorder(YogaEdge.Right, 10f);
|
||||
@@ -45,13 +45,13 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_border_container_match_child()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.SetBorder(YogaEdge.Left, 10f);
|
||||
root.SetBorder(YogaEdge.Top, 10f);
|
||||
root.SetBorder(YogaEdge.Right, 10f);
|
||||
root.SetBorder(YogaEdge.Bottom, 10f);
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.Width = 10f;
|
||||
root_child0.Height = 10f;
|
||||
root.Insert(0, root_child0);
|
||||
@@ -85,7 +85,7 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_border_flex_child()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.SetBorder(YogaEdge.Left, 10f);
|
||||
root.SetBorder(YogaEdge.Top, 10f);
|
||||
root.SetBorder(YogaEdge.Right, 10f);
|
||||
@@ -93,7 +93,7 @@ namespace Facebook.CSSLayout
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.FlexGrow = 1f;
|
||||
root_child0.Width = 10f;
|
||||
root.Insert(0, root_child0);
|
||||
@@ -127,7 +127,7 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_border_stretch_child()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.SetBorder(YogaEdge.Left, 10f);
|
||||
root.SetBorder(YogaEdge.Top, 10f);
|
||||
root.SetBorder(YogaEdge.Right, 10f);
|
||||
@@ -135,7 +135,7 @@ namespace Facebook.CSSLayout
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.Height = 10f;
|
||||
root.Insert(0, root_child0);
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
@@ -168,7 +168,7 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_border_center_child()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.JustifyContent = YogaJustify.Center;
|
||||
root.AlignItems = YogaAlign.Center;
|
||||
root.SetBorder(YogaEdge.Start, 10f);
|
||||
@@ -177,7 +177,7 @@ namespace Facebook.CSSLayout
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.Width = 10f;
|
||||
root_child0.Height = 10f;
|
||||
root.Insert(0, root_child0);
|
@@ -12,7 +12,7 @@
|
||||
using System;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace Facebook.CSSLayout
|
||||
namespace Facebook.Yoga
|
||||
{
|
||||
[TestFixture]
|
||||
public class CSSLayoutFlexDirectionTest
|
||||
@@ -20,18 +20,18 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_flex_direction_column_no_height()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.Width = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.Height = 10f;
|
||||
root.Insert(0, root_child0);
|
||||
|
||||
CSSNode root_child1 = new CSSNode();
|
||||
YogaNode root_child1 = new YogaNode();
|
||||
root_child1.Height = 10f;
|
||||
root.Insert(1, root_child1);
|
||||
|
||||
CSSNode root_child2 = new CSSNode();
|
||||
YogaNode root_child2 = new YogaNode();
|
||||
root_child2.Height = 10f;
|
||||
root.Insert(2, root_child2);
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
@@ -84,19 +84,19 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_flex_direction_row_no_width()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.FlexDirection = YogaFlexDirection.Row;
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.Width = 10f;
|
||||
root.Insert(0, root_child0);
|
||||
|
||||
CSSNode root_child1 = new CSSNode();
|
||||
YogaNode root_child1 = new YogaNode();
|
||||
root_child1.Width = 10f;
|
||||
root.Insert(1, root_child1);
|
||||
|
||||
CSSNode root_child2 = new CSSNode();
|
||||
YogaNode root_child2 = new YogaNode();
|
||||
root_child2.Width = 10f;
|
||||
root.Insert(2, root_child2);
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
@@ -149,19 +149,19 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_flex_direction_column()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.Height = 10f;
|
||||
root.Insert(0, root_child0);
|
||||
|
||||
CSSNode root_child1 = new CSSNode();
|
||||
YogaNode root_child1 = new YogaNode();
|
||||
root_child1.Height = 10f;
|
||||
root.Insert(1, root_child1);
|
||||
|
||||
CSSNode root_child2 = new CSSNode();
|
||||
YogaNode root_child2 = new YogaNode();
|
||||
root_child2.Height = 10f;
|
||||
root.Insert(2, root_child2);
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
@@ -214,20 +214,20 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_flex_direction_row()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.FlexDirection = YogaFlexDirection.Row;
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.Width = 10f;
|
||||
root.Insert(0, root_child0);
|
||||
|
||||
CSSNode root_child1 = new CSSNode();
|
||||
YogaNode root_child1 = new YogaNode();
|
||||
root_child1.Width = 10f;
|
||||
root.Insert(1, root_child1);
|
||||
|
||||
CSSNode root_child2 = new CSSNode();
|
||||
YogaNode root_child2 = new YogaNode();
|
||||
root_child2.Width = 10f;
|
||||
root.Insert(2, root_child2);
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
@@ -280,20 +280,20 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_flex_direction_column_reverse()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.FlexDirection = YogaFlexDirection.ColumnReverse;
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.Height = 10f;
|
||||
root.Insert(0, root_child0);
|
||||
|
||||
CSSNode root_child1 = new CSSNode();
|
||||
YogaNode root_child1 = new YogaNode();
|
||||
root_child1.Height = 10f;
|
||||
root.Insert(1, root_child1);
|
||||
|
||||
CSSNode root_child2 = new CSSNode();
|
||||
YogaNode root_child2 = new YogaNode();
|
||||
root_child2.Height = 10f;
|
||||
root.Insert(2, root_child2);
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
@@ -346,20 +346,20 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_flex_direction_row_reverse()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.FlexDirection = YogaFlexDirection.RowReverse;
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.Width = 10f;
|
||||
root.Insert(0, root_child0);
|
||||
|
||||
CSSNode root_child1 = new CSSNode();
|
||||
YogaNode root_child1 = new YogaNode();
|
||||
root_child1.Width = 10f;
|
||||
root.Insert(1, root_child1);
|
||||
|
||||
CSSNode root_child2 = new CSSNode();
|
||||
YogaNode root_child2 = new YogaNode();
|
||||
root_child2.Width = 10f;
|
||||
root.Insert(2, root_child2);
|
||||
root.StyleDirection = YogaDirection.LTR;
|
@@ -12,7 +12,7 @@
|
||||
using System;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace Facebook.CSSLayout
|
||||
namespace Facebook.Yoga
|
||||
{
|
||||
[TestFixture]
|
||||
public class CSSLayoutFlexTest
|
||||
@@ -20,16 +20,16 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_flex_basis_flex_grow_column()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.FlexGrow = 1f;
|
||||
root_child0.FlexBasis = 50f;
|
||||
root.Insert(0, root_child0);
|
||||
|
||||
CSSNode root_child1 = new CSSNode();
|
||||
YogaNode root_child1 = new YogaNode();
|
||||
root_child1.FlexGrow = 1f;
|
||||
root.Insert(1, root_child1);
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
@@ -72,17 +72,17 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_flex_basis_flex_grow_row()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.FlexDirection = YogaFlexDirection.Row;
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.FlexGrow = 1f;
|
||||
root_child0.FlexBasis = 50f;
|
||||
root.Insert(0, root_child0);
|
||||
|
||||
CSSNode root_child1 = new CSSNode();
|
||||
YogaNode root_child1 = new YogaNode();
|
||||
root_child1.FlexGrow = 1f;
|
||||
root.Insert(1, root_child1);
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
@@ -125,16 +125,16 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_flex_basis_flex_shrink_column()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.FlexShrink = 1f;
|
||||
root_child0.FlexBasis = 100f;
|
||||
root.Insert(0, root_child0);
|
||||
|
||||
CSSNode root_child1 = new CSSNode();
|
||||
YogaNode root_child1 = new YogaNode();
|
||||
root_child1.FlexBasis = 50f;
|
||||
root.Insert(1, root_child1);
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
@@ -177,17 +177,17 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_flex_basis_flex_shrink_row()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.FlexDirection = YogaFlexDirection.Row;
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.FlexShrink = 1f;
|
||||
root_child0.FlexBasis = 100f;
|
||||
root.Insert(0, root_child0);
|
||||
|
||||
CSSNode root_child1 = new CSSNode();
|
||||
YogaNode root_child1 = new YogaNode();
|
||||
root_child1.FlexBasis = 50f;
|
||||
root.Insert(1, root_child1);
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
@@ -230,21 +230,21 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_flex_shrink_to_zero()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.Height = 75f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.Width = 50f;
|
||||
root_child0.Height = 50f;
|
||||
root.Insert(0, root_child0);
|
||||
|
||||
CSSNode root_child1 = new CSSNode();
|
||||
YogaNode root_child1 = new YogaNode();
|
||||
root_child1.FlexShrink = 1f;
|
||||
root_child1.Width = 50f;
|
||||
root_child1.Height = 50f;
|
||||
root.Insert(1, root_child1);
|
||||
|
||||
CSSNode root_child2 = new CSSNode();
|
||||
YogaNode root_child2 = new YogaNode();
|
||||
root_child2.Width = 50f;
|
||||
root_child2.Height = 50f;
|
||||
root.Insert(2, root_child2);
|
||||
@@ -298,22 +298,22 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_flex_basis_overrides_main_size()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.FlexGrow = 1f;
|
||||
root_child0.FlexBasis = 50f;
|
||||
root_child0.Height = 20f;
|
||||
root.Insert(0, root_child0);
|
||||
|
||||
CSSNode root_child1 = new CSSNode();
|
||||
YogaNode root_child1 = new YogaNode();
|
||||
root_child1.FlexGrow = 1f;
|
||||
root_child1.Height = 10f;
|
||||
root.Insert(1, root_child1);
|
||||
|
||||
CSSNode root_child2 = new CSSNode();
|
||||
YogaNode root_child2 = new YogaNode();
|
||||
root_child2.FlexGrow = 1f;
|
||||
root_child2.Height = 10f;
|
||||
root.Insert(2, root_child2);
|
||||
@@ -367,14 +367,14 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_flex_grow_shrink_at_most()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root.Insert(0, root_child0);
|
||||
|
||||
CSSNode root_child0_child0 = new CSSNode();
|
||||
YogaNode root_child0_child0 = new YogaNode();
|
||||
root_child0_child0.FlexGrow = 1f;
|
||||
root_child0_child0.FlexShrink = 1f;
|
||||
root_child0.Insert(0, root_child0_child0);
|
@@ -12,7 +12,7 @@
|
||||
using System;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace Facebook.CSSLayout
|
||||
namespace Facebook.Yoga
|
||||
{
|
||||
[TestFixture]
|
||||
public class CSSLayoutFlexWrapTest
|
||||
@@ -20,26 +20,26 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_wrap_column()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.Wrap = YogaWrap.Wrap;
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.Width = 30f;
|
||||
root_child0.Height = 30f;
|
||||
root.Insert(0, root_child0);
|
||||
|
||||
CSSNode root_child1 = new CSSNode();
|
||||
YogaNode root_child1 = new YogaNode();
|
||||
root_child1.Width = 30f;
|
||||
root_child1.Height = 30f;
|
||||
root.Insert(1, root_child1);
|
||||
|
||||
CSSNode root_child2 = new CSSNode();
|
||||
YogaNode root_child2 = new YogaNode();
|
||||
root_child2.Width = 30f;
|
||||
root_child2.Height = 30f;
|
||||
root.Insert(2, root_child2);
|
||||
|
||||
CSSNode root_child3 = new CSSNode();
|
||||
YogaNode root_child3 = new YogaNode();
|
||||
root_child3.Width = 30f;
|
||||
root_child3.Height = 30f;
|
||||
root.Insert(3, root_child3);
|
||||
@@ -103,27 +103,27 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_wrap_row()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.FlexDirection = YogaFlexDirection.Row;
|
||||
root.Wrap = YogaWrap.Wrap;
|
||||
root.Width = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.Width = 30f;
|
||||
root_child0.Height = 30f;
|
||||
root.Insert(0, root_child0);
|
||||
|
||||
CSSNode root_child1 = new CSSNode();
|
||||
YogaNode root_child1 = new YogaNode();
|
||||
root_child1.Width = 30f;
|
||||
root_child1.Height = 30f;
|
||||
root.Insert(1, root_child1);
|
||||
|
||||
CSSNode root_child2 = new CSSNode();
|
||||
YogaNode root_child2 = new YogaNode();
|
||||
root_child2.Width = 30f;
|
||||
root_child2.Height = 30f;
|
||||
root.Insert(2, root_child2);
|
||||
|
||||
CSSNode root_child3 = new CSSNode();
|
||||
YogaNode root_child3 = new YogaNode();
|
||||
root_child3.Width = 30f;
|
||||
root_child3.Height = 30f;
|
||||
root.Insert(3, root_child3);
|
||||
@@ -187,28 +187,28 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_wrap_row_align_items_flex_end()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.FlexDirection = YogaFlexDirection.Row;
|
||||
root.AlignItems = YogaAlign.FlexEnd;
|
||||
root.Wrap = YogaWrap.Wrap;
|
||||
root.Width = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.Width = 30f;
|
||||
root_child0.Height = 10f;
|
||||
root.Insert(0, root_child0);
|
||||
|
||||
CSSNode root_child1 = new CSSNode();
|
||||
YogaNode root_child1 = new YogaNode();
|
||||
root_child1.Width = 30f;
|
||||
root_child1.Height = 20f;
|
||||
root.Insert(1, root_child1);
|
||||
|
||||
CSSNode root_child2 = new CSSNode();
|
||||
YogaNode root_child2 = new YogaNode();
|
||||
root_child2.Width = 30f;
|
||||
root_child2.Height = 30f;
|
||||
root.Insert(2, root_child2);
|
||||
|
||||
CSSNode root_child3 = new CSSNode();
|
||||
YogaNode root_child3 = new YogaNode();
|
||||
root_child3.Width = 30f;
|
||||
root_child3.Height = 30f;
|
||||
root.Insert(3, root_child3);
|
||||
@@ -272,28 +272,28 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_wrap_row_align_items_center()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.FlexDirection = YogaFlexDirection.Row;
|
||||
root.AlignItems = YogaAlign.Center;
|
||||
root.Wrap = YogaWrap.Wrap;
|
||||
root.Width = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.Width = 30f;
|
||||
root_child0.Height = 10f;
|
||||
root.Insert(0, root_child0);
|
||||
|
||||
CSSNode root_child1 = new CSSNode();
|
||||
YogaNode root_child1 = new YogaNode();
|
||||
root_child1.Width = 30f;
|
||||
root_child1.Height = 20f;
|
||||
root.Insert(1, root_child1);
|
||||
|
||||
CSSNode root_child2 = new CSSNode();
|
||||
YogaNode root_child2 = new YogaNode();
|
||||
root_child2.Width = 30f;
|
||||
root_child2.Height = 30f;
|
||||
root.Insert(2, root_child2);
|
||||
|
||||
CSSNode root_child3 = new CSSNode();
|
||||
YogaNode root_child3 = new YogaNode();
|
||||
root_child3.Width = 30f;
|
||||
root_child3.Height = 30f;
|
||||
root.Insert(3, root_child3);
|
@@ -12,7 +12,7 @@
|
||||
using System;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace Facebook.CSSLayout
|
||||
namespace Facebook.Yoga
|
||||
{
|
||||
[TestFixture]
|
||||
public class CSSLayoutJustifyContentTest
|
||||
@@ -20,20 +20,20 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_justify_content_row_flex_start()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.FlexDirection = YogaFlexDirection.Row;
|
||||
root.Width = 102f;
|
||||
root.Height = 102f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.Width = 10f;
|
||||
root.Insert(0, root_child0);
|
||||
|
||||
CSSNode root_child1 = new CSSNode();
|
||||
YogaNode root_child1 = new YogaNode();
|
||||
root_child1.Width = 10f;
|
||||
root.Insert(1, root_child1);
|
||||
|
||||
CSSNode root_child2 = new CSSNode();
|
||||
YogaNode root_child2 = new YogaNode();
|
||||
root_child2.Width = 10f;
|
||||
root.Insert(2, root_child2);
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
@@ -86,21 +86,21 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_justify_content_row_flex_end()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.FlexDirection = YogaFlexDirection.Row;
|
||||
root.JustifyContent = YogaJustify.FlexEnd;
|
||||
root.Width = 102f;
|
||||
root.Height = 102f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.Width = 10f;
|
||||
root.Insert(0, root_child0);
|
||||
|
||||
CSSNode root_child1 = new CSSNode();
|
||||
YogaNode root_child1 = new YogaNode();
|
||||
root_child1.Width = 10f;
|
||||
root.Insert(1, root_child1);
|
||||
|
||||
CSSNode root_child2 = new CSSNode();
|
||||
YogaNode root_child2 = new YogaNode();
|
||||
root_child2.Width = 10f;
|
||||
root.Insert(2, root_child2);
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
@@ -153,21 +153,21 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_justify_content_row_center()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.FlexDirection = YogaFlexDirection.Row;
|
||||
root.JustifyContent = YogaJustify.Center;
|
||||
root.Width = 102f;
|
||||
root.Height = 102f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.Width = 10f;
|
||||
root.Insert(0, root_child0);
|
||||
|
||||
CSSNode root_child1 = new CSSNode();
|
||||
YogaNode root_child1 = new YogaNode();
|
||||
root_child1.Width = 10f;
|
||||
root.Insert(1, root_child1);
|
||||
|
||||
CSSNode root_child2 = new CSSNode();
|
||||
YogaNode root_child2 = new YogaNode();
|
||||
root_child2.Width = 10f;
|
||||
root.Insert(2, root_child2);
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
@@ -220,21 +220,21 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_justify_content_row_space_between()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.FlexDirection = YogaFlexDirection.Row;
|
||||
root.JustifyContent = YogaJustify.SpaceBetween;
|
||||
root.Width = 102f;
|
||||
root.Height = 102f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.Width = 10f;
|
||||
root.Insert(0, root_child0);
|
||||
|
||||
CSSNode root_child1 = new CSSNode();
|
||||
YogaNode root_child1 = new YogaNode();
|
||||
root_child1.Width = 10f;
|
||||
root.Insert(1, root_child1);
|
||||
|
||||
CSSNode root_child2 = new CSSNode();
|
||||
YogaNode root_child2 = new YogaNode();
|
||||
root_child2.Width = 10f;
|
||||
root.Insert(2, root_child2);
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
@@ -287,21 +287,21 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_justify_content_row_space_around()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.FlexDirection = YogaFlexDirection.Row;
|
||||
root.JustifyContent = YogaJustify.SpaceAround;
|
||||
root.Width = 102f;
|
||||
root.Height = 102f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.Width = 10f;
|
||||
root.Insert(0, root_child0);
|
||||
|
||||
CSSNode root_child1 = new CSSNode();
|
||||
YogaNode root_child1 = new YogaNode();
|
||||
root_child1.Width = 10f;
|
||||
root.Insert(1, root_child1);
|
||||
|
||||
CSSNode root_child2 = new CSSNode();
|
||||
YogaNode root_child2 = new YogaNode();
|
||||
root_child2.Width = 10f;
|
||||
root.Insert(2, root_child2);
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
@@ -354,18 +354,18 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_justify_content_column_flex_start()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.Width = 102f;
|
||||
root.Height = 102f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.Height = 10f;
|
||||
root.Insert(0, root_child0);
|
||||
|
||||
CSSNode root_child1 = new CSSNode();
|
||||
YogaNode root_child1 = new YogaNode();
|
||||
root.Insert(1, root_child1);
|
||||
|
||||
CSSNode root_child2 = new CSSNode();
|
||||
YogaNode root_child2 = new YogaNode();
|
||||
root_child2.Height = 10f;
|
||||
root.Insert(2, root_child2);
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
@@ -418,20 +418,20 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_justify_content_column_flex_end()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.JustifyContent = YogaJustify.FlexEnd;
|
||||
root.Width = 102f;
|
||||
root.Height = 102f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.Height = 10f;
|
||||
root.Insert(0, root_child0);
|
||||
|
||||
CSSNode root_child1 = new CSSNode();
|
||||
YogaNode root_child1 = new YogaNode();
|
||||
root_child1.Height = 10f;
|
||||
root.Insert(1, root_child1);
|
||||
|
||||
CSSNode root_child2 = new CSSNode();
|
||||
YogaNode root_child2 = new YogaNode();
|
||||
root_child2.Height = 10f;
|
||||
root.Insert(2, root_child2);
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
@@ -484,20 +484,20 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_justify_content_column_center()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.JustifyContent = YogaJustify.Center;
|
||||
root.Width = 102f;
|
||||
root.Height = 102f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.Height = 10f;
|
||||
root.Insert(0, root_child0);
|
||||
|
||||
CSSNode root_child1 = new CSSNode();
|
||||
YogaNode root_child1 = new YogaNode();
|
||||
root_child1.Height = 10f;
|
||||
root.Insert(1, root_child1);
|
||||
|
||||
CSSNode root_child2 = new CSSNode();
|
||||
YogaNode root_child2 = new YogaNode();
|
||||
root_child2.Height = 10f;
|
||||
root.Insert(2, root_child2);
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
@@ -550,20 +550,20 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_justify_content_column_space_between()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.JustifyContent = YogaJustify.SpaceBetween;
|
||||
root.Width = 102f;
|
||||
root.Height = 102f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.Height = 10f;
|
||||
root.Insert(0, root_child0);
|
||||
|
||||
CSSNode root_child1 = new CSSNode();
|
||||
YogaNode root_child1 = new YogaNode();
|
||||
root_child1.Height = 10f;
|
||||
root.Insert(1, root_child1);
|
||||
|
||||
CSSNode root_child2 = new CSSNode();
|
||||
YogaNode root_child2 = new YogaNode();
|
||||
root_child2.Height = 10f;
|
||||
root.Insert(2, root_child2);
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
@@ -616,20 +616,20 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_justify_content_column_space_around()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.JustifyContent = YogaJustify.SpaceAround;
|
||||
root.Width = 102f;
|
||||
root.Height = 102f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.Height = 10f;
|
||||
root.Insert(0, root_child0);
|
||||
|
||||
CSSNode root_child1 = new CSSNode();
|
||||
YogaNode root_child1 = new YogaNode();
|
||||
root_child1.Height = 10f;
|
||||
root.Insert(1, root_child1);
|
||||
|
||||
CSSNode root_child2 = new CSSNode();
|
||||
YogaNode root_child2 = new YogaNode();
|
||||
root_child2.Height = 10f;
|
||||
root.Insert(2, root_child2);
|
||||
root.StyleDirection = YogaDirection.LTR;
|
@@ -12,7 +12,7 @@
|
||||
using System;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace Facebook.CSSLayout
|
||||
namespace Facebook.Yoga
|
||||
{
|
||||
[TestFixture]
|
||||
public class CSSLayoutMarginTest
|
||||
@@ -20,12 +20,12 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_margin_start()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.FlexDirection = YogaFlexDirection.Row;
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.SetMargin(YogaEdge.Start, 10f);
|
||||
root_child0.Width = 10f;
|
||||
root.Insert(0, root_child0);
|
||||
@@ -59,11 +59,11 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_margin_top()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.SetMargin(YogaEdge.Top, 10f);
|
||||
root_child0.Height = 10f;
|
||||
root.Insert(0, root_child0);
|
||||
@@ -97,13 +97,13 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_margin_end()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.FlexDirection = YogaFlexDirection.Row;
|
||||
root.JustifyContent = YogaJustify.FlexEnd;
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.SetMargin(YogaEdge.End, 10f);
|
||||
root_child0.Width = 10f;
|
||||
root.Insert(0, root_child0);
|
||||
@@ -137,12 +137,12 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_margin_bottom()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.JustifyContent = YogaJustify.FlexEnd;
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.SetMargin(YogaEdge.Bottom, 10f);
|
||||
root_child0.Height = 10f;
|
||||
root.Insert(0, root_child0);
|
||||
@@ -176,12 +176,12 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_margin_and_flex_row()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.FlexDirection = YogaFlexDirection.Row;
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.FlexGrow = 1f;
|
||||
root_child0.SetMargin(YogaEdge.Start, 10f);
|
||||
root.Insert(0, root_child0);
|
||||
@@ -215,11 +215,11 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_margin_and_flex_column()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.FlexGrow = 1f;
|
||||
root_child0.SetMargin(YogaEdge.Top, 10f);
|
||||
root.Insert(0, root_child0);
|
||||
@@ -253,12 +253,12 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_margin_and_stretch_row()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.FlexDirection = YogaFlexDirection.Row;
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.FlexGrow = 1f;
|
||||
root_child0.SetMargin(YogaEdge.Top, 10f);
|
||||
root.Insert(0, root_child0);
|
||||
@@ -292,11 +292,11 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_margin_and_stretch_column()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.FlexGrow = 1f;
|
||||
root_child0.SetMargin(YogaEdge.Start, 10f);
|
||||
root.Insert(0, root_child0);
|
||||
@@ -330,16 +330,16 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_margin_with_sibling_row()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.FlexDirection = YogaFlexDirection.Row;
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.FlexGrow = 1f;
|
||||
root.Insert(0, root_child0);
|
||||
|
||||
CSSNode root_child1 = new CSSNode();
|
||||
YogaNode root_child1 = new YogaNode();
|
||||
root_child1.FlexGrow = 1f;
|
||||
root.Insert(1, root_child1);
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
@@ -382,15 +382,15 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_margin_with_sibling_column()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.FlexGrow = 1f;
|
||||
root.Insert(0, root_child0);
|
||||
|
||||
CSSNode root_child1 = new CSSNode();
|
||||
YogaNode root_child1 = new YogaNode();
|
||||
root_child1.FlexGrow = 1f;
|
||||
root.Insert(1, root_child1);
|
||||
root.StyleDirection = YogaDirection.LTR;
|
@@ -12,7 +12,7 @@
|
||||
using System;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace Facebook.CSSLayout
|
||||
namespace Facebook.Yoga
|
||||
{
|
||||
[TestFixture]
|
||||
public class CSSLayoutMinMaxDimensionTest
|
||||
@@ -20,11 +20,11 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_max_width()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.MaxWidth = 50f;
|
||||
root_child0.Height = 10f;
|
||||
root.Insert(0, root_child0);
|
||||
@@ -58,12 +58,12 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_max_height()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.FlexDirection = YogaFlexDirection.Row;
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.Width = 10f;
|
||||
root_child0.MaxHeight = 50f;
|
||||
root.Insert(0, root_child0);
|
||||
@@ -97,16 +97,16 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_min_height()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.FlexGrow = 1f;
|
||||
root_child0.MinHeight = 60f;
|
||||
root.Insert(0, root_child0);
|
||||
|
||||
CSSNode root_child1 = new CSSNode();
|
||||
YogaNode root_child1 = new YogaNode();
|
||||
root_child1.FlexGrow = 1f;
|
||||
root.Insert(1, root_child1);
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
@@ -149,17 +149,17 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_min_width()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.FlexDirection = YogaFlexDirection.Row;
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.FlexGrow = 1f;
|
||||
root_child0.MinWidth = 60f;
|
||||
root.Insert(0, root_child0);
|
||||
|
||||
CSSNode root_child1 = new CSSNode();
|
||||
YogaNode root_child1 = new YogaNode();
|
||||
root_child1.FlexGrow = 1f;
|
||||
root.Insert(1, root_child1);
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
@@ -202,13 +202,13 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_justify_content_min_max()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.JustifyContent = YogaJustify.Center;
|
||||
root.Width = 100f;
|
||||
root.MinHeight = 100f;
|
||||
root.MaxHeight = 200f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.Width = 60f;
|
||||
root_child0.Height = 60f;
|
||||
root.Insert(0, root_child0);
|
||||
@@ -242,13 +242,13 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_align_items_min_max()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.AlignItems = YogaAlign.Center;
|
||||
root.MinWidth = 100f;
|
||||
root.MaxWidth = 200f;
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.Width = 60f;
|
||||
root_child0.Height = 60f;
|
||||
root.Insert(0, root_child0);
|
||||
@@ -282,22 +282,22 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_justify_content_overflow_min_max()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.JustifyContent = YogaJustify.Center;
|
||||
root.MinHeight = 100f;
|
||||
root.MaxHeight = 110f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.Width = 50f;
|
||||
root_child0.Height = 50f;
|
||||
root.Insert(0, root_child0);
|
||||
|
||||
CSSNode root_child1 = new CSSNode();
|
||||
YogaNode root_child1 = new YogaNode();
|
||||
root_child1.Width = 50f;
|
||||
root_child1.Height = 50f;
|
||||
root.Insert(1, root_child1);
|
||||
|
||||
CSSNode root_child2 = new CSSNode();
|
||||
YogaNode root_child2 = new YogaNode();
|
||||
root_child2.Width = 50f;
|
||||
root_child2.Height = 50f;
|
||||
root.Insert(2, root_child2);
|
||||
@@ -351,16 +351,16 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_flex_grow_within_max_width()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.Width = 200f;
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.FlexDirection = YogaFlexDirection.Row;
|
||||
root_child0.MaxWidth = 100f;
|
||||
root.Insert(0, root_child0);
|
||||
|
||||
CSSNode root_child0_child0 = new CSSNode();
|
||||
YogaNode root_child0_child0 = new YogaNode();
|
||||
root_child0_child0.FlexGrow = 1f;
|
||||
root_child0_child0.Height = 20f;
|
||||
root_child0.Insert(0, root_child0_child0);
|
||||
@@ -404,16 +404,16 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_flex_grow_within_constrained_max_width()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.Width = 200f;
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.FlexDirection = YogaFlexDirection.Row;
|
||||
root_child0.MaxWidth = 300f;
|
||||
root.Insert(0, root_child0);
|
||||
|
||||
CSSNode root_child0_child0 = new CSSNode();
|
||||
YogaNode root_child0_child0 = new YogaNode();
|
||||
root_child0_child0.FlexGrow = 1f;
|
||||
root_child0_child0.Height = 20f;
|
||||
root_child0.Insert(0, root_child0_child0);
|
@@ -12,7 +12,7 @@
|
||||
using System;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace Facebook.CSSLayout
|
||||
namespace Facebook.Yoga
|
||||
{
|
||||
[TestFixture]
|
||||
public class CSSLayoutPaddingTest
|
||||
@@ -20,7 +20,7 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_padding_no_size()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.SetPadding(YogaEdge.Left, 10f);
|
||||
root.SetPadding(YogaEdge.Top, 10f);
|
||||
root.SetPadding(YogaEdge.Right, 10f);
|
||||
@@ -45,13 +45,13 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_padding_container_match_child()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.SetPadding(YogaEdge.Left, 10f);
|
||||
root.SetPadding(YogaEdge.Top, 10f);
|
||||
root.SetPadding(YogaEdge.Right, 10f);
|
||||
root.SetPadding(YogaEdge.Bottom, 10f);
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.Width = 10f;
|
||||
root_child0.Height = 10f;
|
||||
root.Insert(0, root_child0);
|
||||
@@ -85,7 +85,7 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_padding_flex_child()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.SetPadding(YogaEdge.Left, 10f);
|
||||
root.SetPadding(YogaEdge.Top, 10f);
|
||||
root.SetPadding(YogaEdge.Right, 10f);
|
||||
@@ -93,7 +93,7 @@ namespace Facebook.CSSLayout
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.FlexGrow = 1f;
|
||||
root_child0.Width = 10f;
|
||||
root.Insert(0, root_child0);
|
||||
@@ -127,7 +127,7 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_padding_stretch_child()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.SetPadding(YogaEdge.Left, 10f);
|
||||
root.SetPadding(YogaEdge.Top, 10f);
|
||||
root.SetPadding(YogaEdge.Right, 10f);
|
||||
@@ -135,7 +135,7 @@ namespace Facebook.CSSLayout
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.Height = 10f;
|
||||
root.Insert(0, root_child0);
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
@@ -168,7 +168,7 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_padding_center_child()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.JustifyContent = YogaJustify.Center;
|
||||
root.AlignItems = YogaAlign.Center;
|
||||
root.SetPadding(YogaEdge.Start, 10f);
|
||||
@@ -177,7 +177,7 @@ namespace Facebook.CSSLayout
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.Width = 10f;
|
||||
root_child0.Height = 10f;
|
||||
root.Insert(0, root_child0);
|
||||
@@ -211,13 +211,13 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_child_with_padding_align_end()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.JustifyContent = YogaJustify.FlexEnd;
|
||||
root.AlignItems = YogaAlign.FlexEnd;
|
||||
root.Width = 200f;
|
||||
root.Height = 200f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.SetPadding(YogaEdge.Left, 20f);
|
||||
root_child0.SetPadding(YogaEdge.Top, 20f);
|
||||
root_child0.SetPadding(YogaEdge.Right, 20f);
|
@@ -12,7 +12,7 @@
|
||||
using System;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace Facebook.CSSLayout
|
||||
namespace Facebook.Yoga
|
||||
{
|
||||
[TestFixture]
|
||||
public class CSSLayoutRoundingTest
|
||||
@@ -20,22 +20,22 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_rounding_flex_basis_flex_grow_row_width_of_100()
|
||||
{
|
||||
CSSNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true);
|
||||
YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true);
|
||||
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.FlexDirection = YogaFlexDirection.Row;
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.FlexGrow = 1f;
|
||||
root.Insert(0, root_child0);
|
||||
|
||||
CSSNode root_child1 = new CSSNode();
|
||||
YogaNode root_child1 = new YogaNode();
|
||||
root_child1.FlexGrow = 1f;
|
||||
root.Insert(1, root_child1);
|
||||
|
||||
CSSNode root_child2 = new CSSNode();
|
||||
YogaNode root_child2 = new YogaNode();
|
||||
root_child2.FlexGrow = 1f;
|
||||
root.Insert(2, root_child2);
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
@@ -84,36 +84,36 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(33f, root_child2.LayoutWidth);
|
||||
Assert.AreEqual(100f, root_child2.LayoutHeight);
|
||||
|
||||
CSSNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, false);
|
||||
YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, false);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Test_rounding_flex_basis_flex_grow_row_prime_number_width()
|
||||
{
|
||||
CSSNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true);
|
||||
YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true);
|
||||
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.FlexDirection = YogaFlexDirection.Row;
|
||||
root.Width = 113f;
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.FlexGrow = 1f;
|
||||
root.Insert(0, root_child0);
|
||||
|
||||
CSSNode root_child1 = new CSSNode();
|
||||
YogaNode root_child1 = new YogaNode();
|
||||
root_child1.FlexGrow = 1f;
|
||||
root.Insert(1, root_child1);
|
||||
|
||||
CSSNode root_child2 = new CSSNode();
|
||||
YogaNode root_child2 = new YogaNode();
|
||||
root_child2.FlexGrow = 1f;
|
||||
root.Insert(2, root_child2);
|
||||
|
||||
CSSNode root_child3 = new CSSNode();
|
||||
YogaNode root_child3 = new YogaNode();
|
||||
root_child3.FlexGrow = 1f;
|
||||
root.Insert(3, root_child3);
|
||||
|
||||
CSSNode root_child4 = new CSSNode();
|
||||
YogaNode root_child4 = new YogaNode();
|
||||
root_child4.FlexGrow = 1f;
|
||||
root.Insert(4, root_child4);
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
@@ -182,29 +182,29 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(23f, root_child4.LayoutWidth);
|
||||
Assert.AreEqual(100f, root_child4.LayoutHeight);
|
||||
|
||||
CSSNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, false);
|
||||
YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, false);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Test_rounding_flex_basis_flex_shrink_row()
|
||||
{
|
||||
CSSNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true);
|
||||
YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true);
|
||||
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.FlexDirection = YogaFlexDirection.Row;
|
||||
root.Width = 101f;
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.FlexShrink = 1f;
|
||||
root_child0.FlexBasis = 100f;
|
||||
root.Insert(0, root_child0);
|
||||
|
||||
CSSNode root_child1 = new CSSNode();
|
||||
YogaNode root_child1 = new YogaNode();
|
||||
root_child1.FlexBasis = 25f;
|
||||
root.Insert(1, root_child1);
|
||||
|
||||
CSSNode root_child2 = new CSSNode();
|
||||
YogaNode root_child2 = new YogaNode();
|
||||
root_child2.FlexBasis = 25f;
|
||||
root.Insert(2, root_child2);
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
@@ -253,30 +253,30 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(25f, root_child2.LayoutWidth);
|
||||
Assert.AreEqual(100f, root_child2.LayoutHeight);
|
||||
|
||||
CSSNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, false);
|
||||
YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, false);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Test_rounding_flex_basis_overrides_main_size()
|
||||
{
|
||||
CSSNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true);
|
||||
YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true);
|
||||
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.Width = 100f;
|
||||
root.Height = 113f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.FlexGrow = 1f;
|
||||
root_child0.FlexBasis = 50f;
|
||||
root_child0.Height = 20f;
|
||||
root.Insert(0, root_child0);
|
||||
|
||||
CSSNode root_child1 = new CSSNode();
|
||||
YogaNode root_child1 = new YogaNode();
|
||||
root_child1.FlexGrow = 1f;
|
||||
root_child1.Height = 10f;
|
||||
root.Insert(1, root_child1);
|
||||
|
||||
CSSNode root_child2 = new CSSNode();
|
||||
YogaNode root_child2 = new YogaNode();
|
||||
root_child2.FlexGrow = 1f;
|
||||
root_child2.Height = 10f;
|
||||
root.Insert(2, root_child2);
|
||||
@@ -326,30 +326,30 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(100f, root_child2.LayoutWidth);
|
||||
Assert.AreEqual(24f, root_child2.LayoutHeight);
|
||||
|
||||
CSSNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, false);
|
||||
YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, false);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Test_rounding_total_fractial()
|
||||
{
|
||||
CSSNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true);
|
||||
YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true);
|
||||
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.Width = 87.4f;
|
||||
root.Height = 113.4f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.FlexGrow = 0.7f;
|
||||
root_child0.FlexBasis = 50.3f;
|
||||
root_child0.Height = 20.3f;
|
||||
root.Insert(0, root_child0);
|
||||
|
||||
CSSNode root_child1 = new CSSNode();
|
||||
YogaNode root_child1 = new YogaNode();
|
||||
root_child1.FlexGrow = 1.6f;
|
||||
root_child1.Height = 10f;
|
||||
root.Insert(1, root_child1);
|
||||
|
||||
CSSNode root_child2 = new CSSNode();
|
||||
YogaNode root_child2 = new YogaNode();
|
||||
root_child2.FlexGrow = 1.1f;
|
||||
root_child2.Height = 10.7f;
|
||||
root.Insert(2, root_child2);
|
||||
@@ -399,44 +399,44 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(87f, root_child2.LayoutWidth);
|
||||
Assert.AreEqual(24f, root_child2.LayoutHeight);
|
||||
|
||||
CSSNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, false);
|
||||
YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, false);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Test_rounding_total_fractial_nested()
|
||||
{
|
||||
CSSNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true);
|
||||
YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true);
|
||||
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.Width = 87.4f;
|
||||
root.Height = 113.4f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.FlexGrow = 0.7f;
|
||||
root_child0.FlexBasis = 50.3f;
|
||||
root_child0.Height = 20.3f;
|
||||
root.Insert(0, root_child0);
|
||||
|
||||
CSSNode root_child0_child0 = new CSSNode();
|
||||
YogaNode root_child0_child0 = new YogaNode();
|
||||
root_child0_child0.FlexGrow = 1f;
|
||||
root_child0_child0.FlexBasis = 0.3f;
|
||||
root_child0_child0.SetPosition(YogaEdge.Bottom, 13.3f);
|
||||
root_child0_child0.Height = 9.9f;
|
||||
root_child0.Insert(0, root_child0_child0);
|
||||
|
||||
CSSNode root_child0_child1 = new CSSNode();
|
||||
YogaNode root_child0_child1 = new YogaNode();
|
||||
root_child0_child1.FlexGrow = 4f;
|
||||
root_child0_child1.FlexBasis = 0.3f;
|
||||
root_child0_child1.SetPosition(YogaEdge.Top, 13.3f);
|
||||
root_child0_child1.Height = 1.1f;
|
||||
root_child0.Insert(1, root_child0_child1);
|
||||
|
||||
CSSNode root_child1 = new CSSNode();
|
||||
YogaNode root_child1 = new YogaNode();
|
||||
root_child1.FlexGrow = 1.6f;
|
||||
root_child1.Height = 10f;
|
||||
root.Insert(1, root_child1);
|
||||
|
||||
CSSNode root_child2 = new CSSNode();
|
||||
YogaNode root_child2 = new YogaNode();
|
||||
root_child2.FlexGrow = 1.1f;
|
||||
root_child2.Height = 10.7f;
|
||||
root.Insert(2, root_child2);
|
||||
@@ -506,30 +506,30 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(87f, root_child2.LayoutWidth);
|
||||
Assert.AreEqual(24f, root_child2.LayoutHeight);
|
||||
|
||||
CSSNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, false);
|
||||
YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, false);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Test_rounding_fractial_input_1()
|
||||
{
|
||||
CSSNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true);
|
||||
YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true);
|
||||
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.Width = 100f;
|
||||
root.Height = 113.4f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.FlexGrow = 1f;
|
||||
root_child0.FlexBasis = 50f;
|
||||
root_child0.Height = 20f;
|
||||
root.Insert(0, root_child0);
|
||||
|
||||
CSSNode root_child1 = new CSSNode();
|
||||
YogaNode root_child1 = new YogaNode();
|
||||
root_child1.FlexGrow = 1f;
|
||||
root_child1.Height = 10f;
|
||||
root.Insert(1, root_child1);
|
||||
|
||||
CSSNode root_child2 = new CSSNode();
|
||||
YogaNode root_child2 = new YogaNode();
|
||||
root_child2.FlexGrow = 1f;
|
||||
root_child2.Height = 10f;
|
||||
root.Insert(2, root_child2);
|
||||
@@ -579,30 +579,30 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(100f, root_child2.LayoutWidth);
|
||||
Assert.AreEqual(24f, root_child2.LayoutHeight);
|
||||
|
||||
CSSNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, false);
|
||||
YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, false);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Test_rounding_fractial_input_2()
|
||||
{
|
||||
CSSNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true);
|
||||
YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true);
|
||||
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.Width = 100f;
|
||||
root.Height = 113.6f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.FlexGrow = 1f;
|
||||
root_child0.FlexBasis = 50f;
|
||||
root_child0.Height = 20f;
|
||||
root.Insert(0, root_child0);
|
||||
|
||||
CSSNode root_child1 = new CSSNode();
|
||||
YogaNode root_child1 = new YogaNode();
|
||||
root_child1.FlexGrow = 1f;
|
||||
root_child1.Height = 10f;
|
||||
root.Insert(1, root_child1);
|
||||
|
||||
CSSNode root_child2 = new CSSNode();
|
||||
YogaNode root_child2 = new YogaNode();
|
||||
root_child2.FlexGrow = 1f;
|
||||
root_child2.Height = 10f;
|
||||
root.Insert(2, root_child2);
|
||||
@@ -652,31 +652,31 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(100f, root_child2.LayoutWidth);
|
||||
Assert.AreEqual(25f, root_child2.LayoutHeight);
|
||||
|
||||
CSSNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, false);
|
||||
YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, false);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Test_rounding_fractial_input_3()
|
||||
{
|
||||
CSSNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true);
|
||||
YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true);
|
||||
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.SetPosition(YogaEdge.Top, 0.3f);
|
||||
root.Width = 100f;
|
||||
root.Height = 113.4f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.FlexGrow = 1f;
|
||||
root_child0.FlexBasis = 50f;
|
||||
root_child0.Height = 20f;
|
||||
root.Insert(0, root_child0);
|
||||
|
||||
CSSNode root_child1 = new CSSNode();
|
||||
YogaNode root_child1 = new YogaNode();
|
||||
root_child1.FlexGrow = 1f;
|
||||
root_child1.Height = 10f;
|
||||
root.Insert(1, root_child1);
|
||||
|
||||
CSSNode root_child2 = new CSSNode();
|
||||
YogaNode root_child2 = new YogaNode();
|
||||
root_child2.FlexGrow = 1f;
|
||||
root_child2.Height = 10f;
|
||||
root.Insert(2, root_child2);
|
||||
@@ -726,31 +726,31 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(100f, root_child2.LayoutWidth);
|
||||
Assert.AreEqual(24f, root_child2.LayoutHeight);
|
||||
|
||||
CSSNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, false);
|
||||
YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, false);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Test_rounding_fractial_input_4()
|
||||
{
|
||||
CSSNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true);
|
||||
YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true);
|
||||
|
||||
CSSNode root = new CSSNode();
|
||||
YogaNode root = new YogaNode();
|
||||
root.SetPosition(YogaEdge.Top, 0.7f);
|
||||
root.Width = 100f;
|
||||
root.Height = 113.4f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
YogaNode root_child0 = new YogaNode();
|
||||
root_child0.FlexGrow = 1f;
|
||||
root_child0.FlexBasis = 50f;
|
||||
root_child0.Height = 20f;
|
||||
root.Insert(0, root_child0);
|
||||
|
||||
CSSNode root_child1 = new CSSNode();
|
||||
YogaNode root_child1 = new YogaNode();
|
||||
root_child1.FlexGrow = 1f;
|
||||
root_child1.Height = 10f;
|
||||
root.Insert(1, root_child1);
|
||||
|
||||
CSSNode root_child2 = new CSSNode();
|
||||
YogaNode root_child2 = new YogaNode();
|
||||
root_child2.FlexGrow = 1f;
|
||||
root_child2.Height = 10f;
|
||||
root.Insert(2, root_child2);
|
||||
@@ -800,7 +800,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(100f, root_child2.LayoutWidth);
|
||||
Assert.AreEqual(24f, root_child2.LayoutHeight);
|
||||
|
||||
CSSNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, false);
|
||||
YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, false);
|
||||
}
|
||||
|
||||
}
|
@@ -11,18 +11,18 @@ using NUnit.Framework;
|
||||
using System;
|
||||
|
||||
/**
|
||||
* Tests for {@link CSSNode}.
|
||||
* Tests for {@link YogaNode}.
|
||||
*/
|
||||
namespace Facebook.CSSLayout
|
||||
namespace Facebook.Yoga
|
||||
{
|
||||
[TestFixture]
|
||||
public class CSSNodeCreateTest
|
||||
public class YogaNodeCreateTest
|
||||
{
|
||||
[Test]
|
||||
public void TestSimple()
|
||||
{
|
||||
CSSNode nodeDefault = new CSSNode();
|
||||
CSSNode nodeCreated = CSSNode.Create(flexDirection: YogaFlexDirection.Row);
|
||||
YogaNode nodeDefault = new YogaNode();
|
||||
YogaNode nodeCreated = YogaNode.Create(flexDirection: YogaFlexDirection.Row);
|
||||
Assert.AreEqual(YogaFlexDirection.Row, nodeCreated.FlexDirection);
|
||||
Assert.IsFalse(nodeDefault.IsDirty);
|
||||
nodeDefault.CopyStyle(nodeCreated);
|
||||
@@ -32,8 +32,8 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void TestSame()
|
||||
{
|
||||
CSSNode nodeDefault = new CSSNode();
|
||||
CSSNode nodeCreated = CSSNode.Create();
|
||||
YogaNode nodeDefault = new YogaNode();
|
||||
YogaNode nodeCreated = YogaNode.Create();
|
||||
Assert.IsFalse(nodeDefault.IsDirty);
|
||||
nodeDefault.CopyStyle(nodeCreated);
|
||||
Assert.IsFalse(nodeDefault.IsDirty);
|
||||
@@ -42,7 +42,7 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void TestMultiple()
|
||||
{
|
||||
CSSNode node = CSSNode.Create(
|
||||
YogaNode node = YogaNode.Create(
|
||||
positionType: YogaPositionType.Absolute,
|
||||
wrap: YogaWrap.Wrap,
|
||||
position: new Spacing(top:6, right:4),
|
||||
@@ -64,7 +64,7 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void TestFull()
|
||||
{
|
||||
CSSNode node = CSSNode.Create(
|
||||
YogaNode node = YogaNode.Create(
|
||||
styleDirection: YogaDirection.RTL,
|
||||
flexDirection: YogaFlexDirection.RowReverse,
|
||||
|
||||
@@ -87,12 +87,12 @@ namespace Facebook.CSSLayout
|
||||
padding: new Spacing(top: 13, bottom: 14, left: 15, right: 16),
|
||||
border: new Spacing(top: 17, bottom: 18, left: 19, right: 20),
|
||||
|
||||
width: 21,
|
||||
height: 22,
|
||||
minWidth: 23,
|
||||
minHeight: 24,
|
||||
maxWidth: 25,
|
||||
maxHeight: 26);
|
||||
Width: 21,
|
||||
Height: 22,
|
||||
MinWidth: 23,
|
||||
MinHeight: 24,
|
||||
MaxWidth: 25,
|
||||
MaxHeight: 26);
|
||||
|
||||
Assert.AreEqual(YogaDirection.RTL, node.StyleDirection);
|
||||
Assert.AreEqual(YogaFlexDirection.RowReverse, node.FlexDirection);
|
@@ -11,18 +11,18 @@ using NUnit.Framework;
|
||||
using System;
|
||||
|
||||
/**
|
||||
* Tests for {@link CSSNode}.
|
||||
* Tests for {@link YogaNode}.
|
||||
*/
|
||||
namespace Facebook.CSSLayout
|
||||
namespace Facebook.Yoga
|
||||
{
|
||||
[TestFixture]
|
||||
public class CSSNodeTest
|
||||
public class YogaNodeTest
|
||||
{
|
||||
[Test]
|
||||
public void TestAddChildGetParent()
|
||||
{
|
||||
CSSNode parent = new CSSNode();
|
||||
CSSNode child = new CSSNode();
|
||||
YogaNode parent = new YogaNode();
|
||||
YogaNode child = new YogaNode();
|
||||
|
||||
Assert.IsNull(child.Parent);
|
||||
Assert.AreEqual(0, parent.Count);
|
||||
@@ -42,22 +42,22 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void TestChildren()
|
||||
{
|
||||
CSSNode parent = new CSSNode();
|
||||
foreach (CSSNode node in parent) {
|
||||
YogaNode parent = new YogaNode();
|
||||
foreach (YogaNode node in parent) {
|
||||
Assert.Fail(node.ToString());
|
||||
}
|
||||
|
||||
CSSNode child0 = new CSSNode();
|
||||
YogaNode child0 = new YogaNode();
|
||||
Assert.AreEqual(-1, parent.IndexOf(child0));
|
||||
parent.Insert(0, child0);
|
||||
foreach (CSSNode node in parent) {
|
||||
foreach (YogaNode node in parent) {
|
||||
Assert.AreEqual(0, parent.IndexOf(node));
|
||||
}
|
||||
|
||||
CSSNode child1 = new CSSNode();
|
||||
YogaNode child1 = new YogaNode();
|
||||
parent.Insert(1, child1);
|
||||
int index = 0;
|
||||
foreach (CSSNode node in parent) {
|
||||
foreach (YogaNode node in parent) {
|
||||
Assert.AreEqual(index++, parent.IndexOf(node));
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ namespace Facebook.CSSLayout
|
||||
[ExpectedException("System.NullReferenceException")]
|
||||
public void TestRemoveAtFromEmpty()
|
||||
{
|
||||
CSSNode parent = new CSSNode();
|
||||
YogaNode parent = new YogaNode();
|
||||
parent.RemoveAt(0);
|
||||
}
|
||||
|
||||
@@ -84,8 +84,8 @@ namespace Facebook.CSSLayout
|
||||
[ExpectedException("System.ArgumentOutOfRangeException")]
|
||||
public void TestRemoveAtOutOfRange()
|
||||
{
|
||||
CSSNode parent = new CSSNode();
|
||||
CSSNode child = new CSSNode();
|
||||
YogaNode parent = new YogaNode();
|
||||
YogaNode child = new YogaNode();
|
||||
parent.Insert(0, child);
|
||||
parent.RemoveAt(1);
|
||||
}
|
||||
@@ -94,9 +94,9 @@ namespace Facebook.CSSLayout
|
||||
[ExpectedException("System.InvalidOperationException")]
|
||||
public void TestCannotAddChildToMultipleParents()
|
||||
{
|
||||
CSSNode parent1 = new CSSNode();
|
||||
CSSNode parent2 = new CSSNode();
|
||||
CSSNode child = new CSSNode();
|
||||
YogaNode parent1 = new YogaNode();
|
||||
YogaNode parent2 = new YogaNode();
|
||||
YogaNode child = new YogaNode();
|
||||
|
||||
parent1.Insert(0, child);
|
||||
parent2.Insert(0, child);
|
||||
@@ -105,19 +105,19 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void TestReset()
|
||||
{
|
||||
int instanceCount = CSSNode.GetInstanceCount();
|
||||
CSSNode node = new CSSNode();
|
||||
Assert.AreEqual(instanceCount + 1, CSSNode.GetInstanceCount());
|
||||
int instanceCount = YogaNode.GetInstanceCount();
|
||||
YogaNode node = new YogaNode();
|
||||
Assert.AreEqual(instanceCount + 1, YogaNode.GetInstanceCount());
|
||||
node.Reset();
|
||||
Assert.AreEqual(instanceCount + 1, CSSNode.GetInstanceCount());
|
||||
Assert.AreEqual(instanceCount + 1, YogaNode.GetInstanceCount());
|
||||
}
|
||||
|
||||
[Test]
|
||||
[ExpectedException("System.InvalidOperationException")]
|
||||
public void TestResetParent()
|
||||
{
|
||||
CSSNode parent = new CSSNode();
|
||||
CSSNode child = new CSSNode();
|
||||
YogaNode parent = new YogaNode();
|
||||
YogaNode child = new YogaNode();
|
||||
parent.Insert(0, child);
|
||||
parent.Reset();
|
||||
}
|
||||
@@ -126,8 +126,8 @@ namespace Facebook.CSSLayout
|
||||
[ExpectedException("System.InvalidOperationException")]
|
||||
public void TestResetChild()
|
||||
{
|
||||
CSSNode parent = new CSSNode();
|
||||
CSSNode child = new CSSNode();
|
||||
YogaNode parent = new YogaNode();
|
||||
YogaNode child = new YogaNode();
|
||||
parent.Insert(0, child);
|
||||
child.Reset();
|
||||
}
|
||||
@@ -135,24 +135,24 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void TestClear()
|
||||
{
|
||||
int instanceCount = CSSNode.GetInstanceCount();
|
||||
CSSNode parent = new CSSNode();
|
||||
Assert.AreEqual(instanceCount + 1, CSSNode.GetInstanceCount());
|
||||
CSSNode child = new CSSNode();
|
||||
Assert.AreEqual(instanceCount + 2, CSSNode.GetInstanceCount());
|
||||
int instanceCount = YogaNode.GetInstanceCount();
|
||||
YogaNode parent = new YogaNode();
|
||||
Assert.AreEqual(instanceCount + 1, YogaNode.GetInstanceCount());
|
||||
YogaNode child = new YogaNode();
|
||||
Assert.AreEqual(instanceCount + 2, YogaNode.GetInstanceCount());
|
||||
parent.Insert(0, child);
|
||||
Assert.AreEqual(1, parent.Count);
|
||||
Assert.AreEqual(parent, child.Parent);
|
||||
parent.Clear();
|
||||
Assert.AreEqual(0, parent.Count);
|
||||
Assert.IsNull(child.Parent);
|
||||
Assert.AreEqual(instanceCount + 2, CSSNode.GetInstanceCount());
|
||||
Assert.AreEqual(instanceCount + 2, YogaNode.GetInstanceCount());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestMeasureFunc()
|
||||
{
|
||||
CSSNode node = new CSSNode();
|
||||
YogaNode node = new YogaNode();
|
||||
node.SetMeasureFunction((_, width, widthMode, height, heightMode) => {
|
||||
return MeasureOutput.Make(100, 150);
|
||||
});
|
||||
@@ -164,7 +164,7 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void TestMeasureFuncWithFloat()
|
||||
{
|
||||
CSSNode node = new CSSNode();
|
||||
YogaNode node = new YogaNode();
|
||||
node.SetMeasureFunction((_, width, widthMode, height, heightMode) => {
|
||||
return MeasureOutput.Make(123.4f, 81.7f);
|
||||
});
|
||||
@@ -177,11 +177,11 @@ namespace Facebook.CSSLayout
|
||||
[ExpectedException("System.InvalidOperationException")]
|
||||
public void TestChildWithMeasureFunc()
|
||||
{
|
||||
CSSNode node = new CSSNode();
|
||||
YogaNode node = new YogaNode();
|
||||
node.SetMeasureFunction((_, width, widthMode, height, heightMode) => {
|
||||
return MeasureOutput.Make(100, 150);
|
||||
});
|
||||
CSSNode child = new CSSNode();
|
||||
YogaNode child = new YogaNode();
|
||||
node.Insert(0, child);
|
||||
}
|
||||
|
||||
@@ -189,8 +189,8 @@ namespace Facebook.CSSLayout
|
||||
[ExpectedException("System.InvalidOperationException")]
|
||||
public void TestMeasureFuncWithChild()
|
||||
{
|
||||
CSSNode node = new CSSNode();
|
||||
CSSNode child = new CSSNode();
|
||||
YogaNode node = new YogaNode();
|
||||
YogaNode child = new YogaNode();
|
||||
node.Insert(0, child);
|
||||
node.SetMeasureFunction((_, width, widthMode, height, heightMode) => {
|
||||
return MeasureOutput.Make(100, 150);
|
||||
@@ -200,13 +200,13 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void TestPrint()
|
||||
{
|
||||
CSSNode parent = new CSSNode();
|
||||
YogaNode parent = new YogaNode();
|
||||
parent.Width = 100;
|
||||
parent.Height = 120;
|
||||
CSSNode child0 = new CSSNode();
|
||||
YogaNode child0 = new YogaNode();
|
||||
child0.Width = 30;
|
||||
child0.Height = 40;
|
||||
CSSNode child1 = new CSSNode();
|
||||
YogaNode child1 = new YogaNode();
|
||||
child1.Width = 35;
|
||||
child1.Height = 45;
|
||||
parent.Insert(0, child0);
|
||||
@@ -218,10 +218,10 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void TestCopyStyle()
|
||||
{
|
||||
CSSNode node0 = new CSSNode();
|
||||
YogaNode node0 = new YogaNode();
|
||||
Assert.IsTrue(YogaConstants.IsUndefined(node0.MaxHeight));
|
||||
|
||||
CSSNode node1 = new CSSNode();
|
||||
YogaNode node1 = new YogaNode();
|
||||
node1.MaxHeight = 100;
|
||||
|
||||
node0.CopyStyle(node1);
|
||||
@@ -239,17 +239,17 @@ namespace Facebook.CSSLayout
|
||||
public void TestDestructor()
|
||||
{
|
||||
ForceGC();
|
||||
int instanceCount = CSSNode.GetInstanceCount();
|
||||
int instanceCount = YogaNode.GetInstanceCount();
|
||||
TestDestructorForGC(instanceCount);
|
||||
ForceGC();
|
||||
Assert.AreEqual(instanceCount, CSSNode.GetInstanceCount());
|
||||
Assert.AreEqual(instanceCount, YogaNode.GetInstanceCount());
|
||||
}
|
||||
|
||||
private void TestDestructorForGC(int instanceCount)
|
||||
{
|
||||
CSSNode node = new CSSNode();
|
||||
YogaNode node = new YogaNode();
|
||||
Assert.IsNotNull(node);
|
||||
Assert.AreEqual(instanceCount + 1, CSSNode.GetInstanceCount());
|
||||
Assert.AreEqual(instanceCount + 1, YogaNode.GetInstanceCount());
|
||||
node = null;
|
||||
}
|
||||
|
||||
@@ -257,32 +257,32 @@ namespace Facebook.CSSLayout
|
||||
public void TestDestructorWithChildren()
|
||||
{
|
||||
ForceGC();
|
||||
int instanceCount = CSSNode.GetInstanceCount();
|
||||
int instanceCount = YogaNode.GetInstanceCount();
|
||||
TestDestructorWithChildrenForGC1(instanceCount);
|
||||
ForceGC();
|
||||
Assert.AreEqual(instanceCount, CSSNode.GetInstanceCount());
|
||||
Assert.AreEqual(instanceCount, YogaNode.GetInstanceCount());
|
||||
}
|
||||
|
||||
private void TestDestructorWithChildrenForGC1(int instanceCount)
|
||||
{
|
||||
CSSNode node = new CSSNode();
|
||||
Assert.AreEqual(instanceCount + 1, CSSNode.GetInstanceCount());
|
||||
YogaNode node = new YogaNode();
|
||||
Assert.AreEqual(instanceCount + 1, YogaNode.GetInstanceCount());
|
||||
|
||||
TestDestructorWithChildrenForGC2(node, instanceCount + 1);
|
||||
ForceGC();
|
||||
Assert.AreEqual(instanceCount + 2, CSSNode.GetInstanceCount());
|
||||
Assert.AreEqual(instanceCount + 2, YogaNode.GetInstanceCount());
|
||||
|
||||
TestDestructorWithChildrenForGC2(node, instanceCount + 2);
|
||||
ForceGC();
|
||||
Assert.AreEqual(instanceCount + 3, CSSNode.GetInstanceCount());
|
||||
Assert.AreEqual(instanceCount + 3, YogaNode.GetInstanceCount());
|
||||
|
||||
node = null;
|
||||
}
|
||||
|
||||
private void TestDestructorWithChildrenForGC2(CSSNode parent, int instanceCount)
|
||||
private void TestDestructorWithChildrenForGC2(YogaNode parent, int instanceCount)
|
||||
{
|
||||
CSSNode child = new CSSNode();
|
||||
Assert.AreEqual(instanceCount + 1, CSSNode.GetInstanceCount());
|
||||
YogaNode child = new YogaNode();
|
||||
Assert.AreEqual(instanceCount + 1, YogaNode.GetInstanceCount());
|
||||
|
||||
parent.Insert(0, child);
|
||||
child = null;
|
||||
@@ -292,21 +292,21 @@ namespace Facebook.CSSLayout
|
||||
public void TestParentDestructor()
|
||||
{
|
||||
ForceGC();
|
||||
int instanceCount = CSSNode.GetInstanceCount();
|
||||
CSSNode child = new CSSNode();
|
||||
Assert.AreEqual(instanceCount + 1, CSSNode.GetInstanceCount());
|
||||
int instanceCount = YogaNode.GetInstanceCount();
|
||||
YogaNode child = new YogaNode();
|
||||
Assert.AreEqual(instanceCount + 1, YogaNode.GetInstanceCount());
|
||||
|
||||
TestParentDestructorForGC(child, instanceCount + 1);
|
||||
ForceGC();
|
||||
|
||||
Assert.IsNull(child.Parent);
|
||||
Assert.AreEqual(instanceCount + 1, CSSNode.GetInstanceCount());
|
||||
Assert.AreEqual(instanceCount + 1, YogaNode.GetInstanceCount());
|
||||
}
|
||||
|
||||
private void TestParentDestructorForGC(CSSNode child, int instanceCount)
|
||||
private void TestParentDestructorForGC(YogaNode child, int instanceCount)
|
||||
{
|
||||
CSSNode parent = new CSSNode();
|
||||
Assert.AreEqual(instanceCount + 1, CSSNode.GetInstanceCount());
|
||||
YogaNode parent = new YogaNode();
|
||||
Assert.AreEqual(instanceCount + 1, YogaNode.GetInstanceCount());
|
||||
parent.Insert(0, child);
|
||||
}
|
||||
|
||||
@@ -314,22 +314,22 @@ namespace Facebook.CSSLayout
|
||||
public void TestClearWithChildDestructor()
|
||||
{
|
||||
ForceGC();
|
||||
int instanceCount = CSSNode.GetInstanceCount();
|
||||
CSSNode node = new CSSNode();
|
||||
Assert.AreEqual(instanceCount + 1, CSSNode.GetInstanceCount());
|
||||
int instanceCount = YogaNode.GetInstanceCount();
|
||||
YogaNode node = new YogaNode();
|
||||
Assert.AreEqual(instanceCount + 1, YogaNode.GetInstanceCount());
|
||||
TestClearWithChildDestructorForGC(node, instanceCount + 1);
|
||||
ForceGC();
|
||||
Assert.AreEqual(instanceCount + 2, CSSNode.GetInstanceCount());
|
||||
Assert.AreEqual(instanceCount + 2, YogaNode.GetInstanceCount());
|
||||
node.Clear();
|
||||
Assert.AreEqual(0, node.Count);
|
||||
ForceGC();
|
||||
Assert.AreEqual(instanceCount + 1, CSSNode.GetInstanceCount());
|
||||
Assert.AreEqual(instanceCount + 1, YogaNode.GetInstanceCount());
|
||||
}
|
||||
|
||||
private void TestClearWithChildDestructorForGC(CSSNode parent, int instanceCount)
|
||||
private void TestClearWithChildDestructorForGC(YogaNode parent, int instanceCount)
|
||||
{
|
||||
CSSNode child = new CSSNode();
|
||||
Assert.AreEqual(instanceCount + 1, CSSNode.GetInstanceCount());
|
||||
YogaNode child = new YogaNode();
|
||||
Assert.AreEqual(instanceCount + 1, YogaNode.GetInstanceCount());
|
||||
parent.Insert(0, child);
|
||||
}
|
||||
|
||||
@@ -337,20 +337,20 @@ namespace Facebook.CSSLayout
|
||||
public void TestMeasureFuncWithDestructor()
|
||||
{
|
||||
ForceGC();
|
||||
int instanceCount = CSSNode.GetInstanceCount();
|
||||
CSSNode parent = new CSSNode();
|
||||
Assert.AreEqual(instanceCount + 1, CSSNode.GetInstanceCount());
|
||||
int instanceCount = YogaNode.GetInstanceCount();
|
||||
YogaNode parent = new YogaNode();
|
||||
Assert.AreEqual(instanceCount + 1, YogaNode.GetInstanceCount());
|
||||
TestMeasureFuncWithDestructorForGC(parent);
|
||||
ForceGC();
|
||||
Assert.AreEqual(instanceCount + 2, CSSNode.GetInstanceCount());
|
||||
Assert.AreEqual(instanceCount + 2, YogaNode.GetInstanceCount());
|
||||
parent.CalculateLayout();
|
||||
Assert.AreEqual(120, (int)parent.LayoutWidth);
|
||||
Assert.AreEqual(130, (int)parent.LayoutHeight);
|
||||
}
|
||||
|
||||
private void TestMeasureFuncWithDestructorForGC(CSSNode parent)
|
||||
private void TestMeasureFuncWithDestructorForGC(YogaNode parent)
|
||||
{
|
||||
CSSNode child = new CSSNode();
|
||||
YogaNode child = new YogaNode();
|
||||
parent.Insert(0, child);
|
||||
child.SetMeasureFunction((_, width, widthMode, height, heightMode) => {
|
||||
return MeasureOutput.Make(120, 130);
|
@@ -28,6 +28,6 @@ if [ -d $NUNIT \
|
||||
rm NUnit-2.6.4.zip
|
||||
fi
|
||||
|
||||
clang -g -Wall -Wextra -dynamiclib -o libCSSLayout.dylib -I../../.. ../../../CSSLayout/*.c ../../CSSLayout/CSSInterop.cpp
|
||||
mcs -debug -t:library -r:$NUNIT/nunit.framework.dll -out:CSSLayoutTest.dll *.cs ../../../csharp/Facebook.CSSLayout/*cs
|
||||
MONO_PATH=$NUNIT mono --arch=64 --debug $NUNIT/nunit-console.exe CSSLayoutTest.dll
|
||||
clang -g -Wall -Wextra -dynamiclib -o libyoga.dylib -I../../.. ../../../CSSLayout/*.c ../../Yoga/YGInterop.cpp
|
||||
mcs -debug -t:library -r:$NUNIT/nunit.framework.dll -out:YogaTest.dll *.cs ../../../csharp/Facebook.Yoga/*cs
|
||||
MONO_PATH=$NUNIT mono --arch=64 --debug $NUNIT/nunit-console.exe YogaTest.dll
|
Reference in New Issue
Block a user