Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add newer fixtures #1194

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
293 changes: 276 additions & 17 deletions csharp/tests/Facebook.Yoga/YGAbsolutePositionTest.cs

Large diffs are not rendered by default.

83 changes: 83 additions & 0 deletions csharp/tests/Facebook.Yoga/YGAlignContentTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1882,5 +1882,88 @@ public void Test_align_content_stretch_is_not_overriding_align_items()
Assert.AreEqual(10f, root_child0_child0.LayoutHeight);
}

[Test]
public void Test_align_content_not_stretch_with_align_items_stretch()
{
YogaConfig config = new YogaConfig();

YogaNode root = new YogaNode(config);
root.FlexDirection = YogaFlexDirection.Row;
root.Wrap = YogaWrap.Wrap;
root.Width = 328;
root.Height = 52;

YogaNode root_child0 = new YogaNode(config);
root.Insert(0, root_child0);

YogaNode root_child0_child0 = new YogaNode(config);
root_child0_child0.Width = 272;
root_child0_child0.Height = 44;
root_child0.Insert(0, root_child0_child0);

YogaNode root_child1 = new YogaNode(config);
root.Insert(1, root_child1);

YogaNode root_child1_child0 = new YogaNode(config);
root_child1_child0.Width = 56;
root_child1_child0.Height = 44;
root_child1.Insert(0, root_child1_child0);
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();

Assert.AreEqual(0f, root.LayoutX);
Assert.AreEqual(0f, root.LayoutY);
Assert.AreEqual(328f, root.LayoutWidth);
Assert.AreEqual(52f, root.LayoutHeight);

Assert.AreEqual(0f, root_child0.LayoutX);
Assert.AreEqual(0f, root_child0.LayoutY);
Assert.AreEqual(272f, root_child0.LayoutWidth);
Assert.AreEqual(44f, root_child0.LayoutHeight);

Assert.AreEqual(0f, root_child0_child0.LayoutX);
Assert.AreEqual(0f, root_child0_child0.LayoutY);
Assert.AreEqual(272f, root_child0_child0.LayoutWidth);
Assert.AreEqual(44f, root_child0_child0.LayoutHeight);

Assert.AreEqual(272f, root_child1.LayoutX);
Assert.AreEqual(0f, root_child1.LayoutY);
Assert.AreEqual(56f, root_child1.LayoutWidth);
Assert.AreEqual(44f, root_child1.LayoutHeight);

Assert.AreEqual(0f, root_child1_child0.LayoutX);
Assert.AreEqual(0f, root_child1_child0.LayoutY);
Assert.AreEqual(56f, root_child1_child0.LayoutWidth);
Assert.AreEqual(44f, root_child1_child0.LayoutHeight);

root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();

Assert.AreEqual(0f, root.LayoutX);
Assert.AreEqual(0f, root.LayoutY);
Assert.AreEqual(328f, root.LayoutWidth);
Assert.AreEqual(52f, root.LayoutHeight);

Assert.AreEqual(56f, root_child0.LayoutX);
Assert.AreEqual(0f, root_child0.LayoutY);
Assert.AreEqual(272f, root_child0.LayoutWidth);
Assert.AreEqual(44f, root_child0.LayoutHeight);

Assert.AreEqual(0f, root_child0_child0.LayoutX);
Assert.AreEqual(0f, root_child0_child0.LayoutY);
Assert.AreEqual(272f, root_child0_child0.LayoutWidth);
Assert.AreEqual(44f, root_child0_child0.LayoutHeight);

Assert.AreEqual(0f, root_child1.LayoutX);
Assert.AreEqual(0f, root_child1.LayoutY);
Assert.AreEqual(56f, root_child1.LayoutWidth);
Assert.AreEqual(44f, root_child1.LayoutHeight);

Assert.AreEqual(0f, root_child1_child0.LayoutX);
Assert.AreEqual(0f, root_child1_child0.LayoutY);
Assert.AreEqual(56f, root_child1_child0.LayoutWidth);
Assert.AreEqual(44f, root_child1_child0.LayoutHeight);
}

}
}
Loading