From f7cc614d67aee4e5be431fe4bc2d23928156b2d3 Mon Sep 17 00:00:00 2001 From: Emil Sjolander Date: Fri, 2 Dec 2016 11:18:16 -0800 Subject: [PATCH] rename csharp code Summary: new name Reviewed By: splhack Differential Revision: D4247106 fbshipit-source-id: 6e1097de104f3a011c78ae65b33e57865b007711 --- .travis.yml | 2 +- csharp/BUCK | 4 +- ...cebook.CSSLayout.sln => Facebook.Yoga.sln} | 4 +- .../Facebook.Yoga.xproj} | 2 +- .../MeasureFunction.cs | 4 +- .../MeasureOutput.cs | 2 +- .../Native.cs | 12 +- .../Properties/AssemblyInfo.cs | 2 +- .../Spacing.cs | 2 +- .../YogaAlign.cs | 2 +- .../YogaConstants.cs | 2 +- .../YogaDimension.cs | 2 +- .../YogaDirection.cs | 2 +- .../YogaEdge.cs | 2 +- .../YogaExperimentalFeature.cs | 2 +- .../YogaFlexDirection.cs | 2 +- .../YogaJustify.cs | 2 +- .../YogaLogLevel.cs | 2 +- .../YogaLogger.cs} | 6 +- .../YogaMeasureFunc.cs} | 4 +- .../YogaMeasureMode.cs | 2 +- .../YogaNode.Create.cs} | 50 +++--- .../CSSNode.cs => Facebook.Yoga/YogaNode.cs} | 52 +++--- .../YogaOverflow.cs | 2 +- .../YogaPositionType.cs | 2 +- .../YogaPrintOptions.cs | 2 +- .../CSSSize.cs => Facebook.Yoga/YogaSize.cs} | 4 +- .../YogaWrap.cs | 2 +- .../project.json | 0 .../CSSInterop.cpp => Yoga/YGInterop.cpp} | 6 +- .../CSSInterop.h => Yoga/YGInterop.h} | 4 +- .../CSSLayout.vcxproj => Yoga/Yoga.vcxproj} | 8 +- .../Yoga.vcxproj.filters} | 6 +- csharp/{CSSLayout => Yoga}/dllmain.cpp | 0 csharp/{CSSLayout => Yoga}/stdafx.cpp | 2 +- csharp/{CSSLayout => Yoga}/stdafx.h | 0 csharp/{CSSLayout => Yoga}/targetver.h | 0 .../CSSLayoutAbsolutePositionTest.cs | 30 ++-- .../CSSLayoutAlignContentTest.cs | 50 +++--- .../CSSLayoutAlignItemsTest.cs | 18 +-- .../CSSLayoutAlignSelfTest.cs | 18 +-- .../CSSLayoutBorderTest.cs | 20 +-- .../CSSLayoutFlexDirectionTest.cs | 50 +++--- .../CSSLayoutFlexTest.cs | 48 +++--- .../CSSLayoutFlexWrapTest.cs | 42 ++--- .../CSSLayoutJustifyContentTest.cs | 82 +++++----- .../CSSLayoutMarginTest.cs | 46 +++--- .../CSSLayoutMinMaxDimensionTest.cs | 50 +++--- .../CSSLayoutPaddingTest.cs | 24 +-- .../CSSLayoutRoundingTest.cs | 130 +++++++-------- .../YogaNodeCreateTest.cs} | 30 ++-- .../YogaNodeTest.cs} | 152 +++++++++--------- .../test_macos.sh | 6 +- enums.py | 4 +- gentest/gentest-cs.js | 10 +- gentest/gentest.rb | 4 +- 56 files changed, 506 insertions(+), 512 deletions(-) rename csharp/{Facebook.CSSLayout.sln => Facebook.Yoga.sln} (88%) rename csharp/{Facebook.CSSLayout/Facebook.CSSLayout.xproj => Facebook.Yoga/Facebook.Yoga.xproj} (95%) rename csharp/{Facebook.CSSLayout => Facebook.Yoga}/MeasureFunction.cs (90%) rename csharp/{Facebook.CSSLayout => Facebook.Yoga}/MeasureOutput.cs (96%) rename csharp/{Facebook.CSSLayout => Facebook.Yoga}/Native.cs (96%) rename csharp/{Facebook.CSSLayout => Facebook.Yoga}/Properties/AssemblyInfo.cs (96%) rename csharp/{Facebook.CSSLayout => Facebook.Yoga}/Spacing.cs (96%) rename csharp/{Facebook.CSSLayout => Facebook.Yoga}/YogaAlign.cs (93%) rename csharp/{Facebook.CSSLayout => Facebook.Yoga}/YogaConstants.cs (94%) rename csharp/{Facebook.CSSLayout => Facebook.Yoga}/YogaDimension.cs (93%) rename csharp/{Facebook.CSSLayout => Facebook.Yoga}/YogaDirection.cs (93%) rename csharp/{Facebook.CSSLayout => Facebook.Yoga}/YogaEdge.cs (94%) rename csharp/{Facebook.CSSLayout => Facebook.Yoga}/YogaExperimentalFeature.cs (93%) rename csharp/{Facebook.CSSLayout => Facebook.Yoga}/YogaFlexDirection.cs (93%) rename csharp/{Facebook.CSSLayout => Facebook.Yoga}/YogaJustify.cs (93%) rename csharp/{Facebook.CSSLayout => Facebook.Yoga}/YogaLogLevel.cs (93%) rename csharp/{Facebook.CSSLayout/CSSLogger.cs => Facebook.Yoga/YogaLogger.cs} (90%) rename csharp/{Facebook.CSSLayout/CSSMeasureFunc.cs => Facebook.Yoga/YogaMeasureFunc.cs} (88%) rename csharp/{Facebook.CSSLayout => Facebook.Yoga}/YogaMeasureMode.cs (93%) rename csharp/{Facebook.CSSLayout/CSSNode.Create.cs => Facebook.Yoga/YogaNode.Create.cs} (84%) rename csharp/{Facebook.CSSLayout/CSSNode.cs => Facebook.Yoga/YogaNode.cs} (90%) rename csharp/{Facebook.CSSLayout => Facebook.Yoga}/YogaOverflow.cs (93%) rename csharp/{Facebook.CSSLayout => Facebook.Yoga}/YogaPositionType.cs (93%) rename csharp/{Facebook.CSSLayout => Facebook.Yoga}/YogaPrintOptions.cs (93%) rename csharp/{Facebook.CSSLayout/CSSSize.cs => Facebook.Yoga/YogaSize.cs} (89%) rename csharp/{Facebook.CSSLayout => Facebook.Yoga}/YogaWrap.cs (92%) rename csharp/{Facebook.CSSLayout => Facebook.Yoga}/project.json (100%) rename csharp/{CSSLayout/CSSInterop.cpp => Yoga/YGInterop.cpp} (83%) rename csharp/{CSSLayout/CSSInterop.h => Yoga/YGInterop.h} (72%) rename csharp/{CSSLayout/CSSLayout.vcxproj => Yoga/Yoga.vcxproj} (96%) rename csharp/{CSSLayout/CSSLayout.vcxproj.filters => Yoga/Yoga.vcxproj.filters} (95%) rename csharp/{CSSLayout => Yoga}/dllmain.cpp (100%) rename csharp/{CSSLayout => Yoga}/stdafx.cpp (91%) rename csharp/{CSSLayout => Yoga}/stdafx.h (100%) rename csharp/{CSSLayout => Yoga}/targetver.h (100%) rename csharp/tests/{Facebook.CSSLayout => Facebook.Yoga}/CSSLayoutAbsolutePositionTest.cs (94%) rename csharp/tests/{Facebook.CSSLayout => Facebook.Yoga}/CSSLayoutAlignContentTest.cs (92%) rename csharp/tests/{Facebook.CSSLayout => Facebook.Yoga}/CSSLayoutAlignItemsTest.cs (93%) rename csharp/tests/{Facebook.CSSLayout => Facebook.Yoga}/CSSLayoutAlignSelfTest.cs (93%) rename csharp/tests/{Facebook.CSSLayout => Facebook.Yoga}/CSSLayoutBorderTest.cs (94%) rename csharp/tests/{Facebook.CSSLayout => Facebook.Yoga}/CSSLayoutFlexDirectionTest.cs (92%) rename csharp/tests/{Facebook.CSSLayout => Facebook.Yoga}/CSSLayoutFlexTest.cs (92%) rename csharp/tests/{Facebook.CSSLayout => Facebook.Yoga}/CSSLayoutFlexWrapTest.cs (92%) rename csharp/tests/{Facebook.CSSLayout => Facebook.Yoga}/CSSLayoutJustifyContentTest.cs (92%) rename csharp/tests/{Facebook.CSSLayout => Facebook.Yoga}/CSSLayoutMarginTest.cs (93%) rename csharp/tests/{Facebook.CSSLayout => Facebook.Yoga}/CSSLayoutMinMaxDimensionTest.cs (93%) rename csharp/tests/{Facebook.CSSLayout => Facebook.Yoga}/CSSLayoutPaddingTest.cs (94%) rename csharp/tests/{Facebook.CSSLayout => Facebook.Yoga}/CSSLayoutRoundingTest.cs (87%) rename csharp/tests/{Facebook.CSSLayout/CSSNodeCreateTest.cs => Facebook.Yoga/YogaNodeCreateTest.cs} (89%) rename csharp/tests/{Facebook.CSSLayout/CSSNodeTest.cs => Facebook.Yoga/YogaNodeTest.cs} (65%) rename csharp/tests/{Facebook.CSSLayout => Facebook.Yoga}/test_macos.sh (80%) diff --git a/.travis.yml b/.travis.yml index 8e09e9ac..c1ad41cb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,7 +24,7 @@ script: - buck test //:CSSLayout - buck test //java:java - buck test //YogaKit:YogaKit --config cxx.default_platform=iphonesimulator-x86_64 --config cxx.cflags=-DTRAVIS_CI - - sh csharp/tests/Facebook.CSSLayout/test_macos.sh + - sh csharp/tests/Facebook.Yoga/test_macos.sh - buck run //benchmark:benchmark - git checkout HEAD^ - buck run //benchmark:benchmark diff --git a/csharp/BUCK b/csharp/BUCK index 0e88d124..6219ab85 100644 --- a/csharp/BUCK +++ b/csharp/BUCK @@ -7,14 +7,14 @@ csharp_library( name = 'csslibnet46', - dll_name = 'Facebook.CSSLayout.dll', + dll_name = 'Facebook.Yoga.dll', framework_ver = 'net46', srcs = glob(['**/*.cs']), ) csharp_library( name = 'csslibnet45', - dll_name = 'Facebook.CSSLayout.dll', + dll_name = 'Facebook.Yoga.dll', framework_ver = 'net45', srcs = glob(['**/*.cs']), ) diff --git a/csharp/Facebook.CSSLayout.sln b/csharp/Facebook.Yoga.sln similarity index 88% rename from csharp/Facebook.CSSLayout.sln rename to csharp/Facebook.Yoga.sln index 5c67bda9..3e8b4078 100644 --- a/csharp/Facebook.CSSLayout.sln +++ b/csharp/Facebook.Yoga.sln @@ -3,9 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 14 VisualStudioVersion = 14.0.25420.1 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CSSLayout", "CSSLayout\CSSLayout.vcxproj", "{0446C86B-F47B-4C46-B673-C7AE0CFF35D5}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Yoga", "Yoga\Yoga.vcxproj", "{0446C86B-F47B-4C46-B673-C7AE0CFF35D5}" EndProject -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Facebook.CSSLayout", "Facebook.CSSLayout\Facebook.CSSLayout.xproj", "{75BB7605-E54B-4EDE-8F5A-FF1F24464236}" +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Facebook.Yoga", "Facebook.Yoga\Facebook.Yoga.xproj", "{75BB7605-E54B-4EDE-8F5A-FF1F24464236}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/csharp/Facebook.CSSLayout/Facebook.CSSLayout.xproj b/csharp/Facebook.Yoga/Facebook.Yoga.xproj similarity index 95% rename from csharp/Facebook.CSSLayout/Facebook.CSSLayout.xproj rename to csharp/Facebook.Yoga/Facebook.Yoga.xproj index 2f3cd6f2..0341d153 100644 --- a/csharp/Facebook.CSSLayout/Facebook.CSSLayout.xproj +++ b/csharp/Facebook.Yoga/Facebook.Yoga.xproj @@ -8,7 +8,7 @@ 75bb7605-e54b-4ede-8f5a-ff1f24464236 - Facebook.CSSLayout + Facebook.Yoga .\obj .\bin\ v4.5.2 diff --git a/csharp/Facebook.CSSLayout/MeasureFunction.cs b/csharp/Facebook.Yoga/MeasureFunction.cs similarity index 90% rename from csharp/Facebook.CSSLayout/MeasureFunction.cs rename to csharp/Facebook.Yoga/MeasureFunction.cs index 3c8128e0..f25ec6da 100644 --- a/csharp/Facebook.CSSLayout/MeasureFunction.cs +++ b/csharp/Facebook.Yoga/MeasureFunction.cs @@ -7,10 +7,10 @@ * of patent rights can be found in the PATENTS file in the same directory. */ -namespace Facebook.CSSLayout +namespace Facebook.Yoga { public delegate long MeasureFunction( - CSSNode node, + YogaNode node, float width, YogaMeasureMode widthMode, float height, diff --git a/csharp/Facebook.CSSLayout/MeasureOutput.cs b/csharp/Facebook.Yoga/MeasureOutput.cs similarity index 96% rename from csharp/Facebook.CSSLayout/MeasureOutput.cs rename to csharp/Facebook.Yoga/MeasureOutput.cs index 10d93a33..380b5b2c 100644 --- a/csharp/Facebook.CSSLayout/MeasureOutput.cs +++ b/csharp/Facebook.Yoga/MeasureOutput.cs @@ -7,7 +7,7 @@ * of patent rights can be found in the PATENTS file in the same directory. */ -namespace Facebook.CSSLayout +namespace Facebook.Yoga { public class MeasureOutput { diff --git a/csharp/Facebook.CSSLayout/Native.cs b/csharp/Facebook.Yoga/Native.cs similarity index 96% rename from csharp/Facebook.CSSLayout/Native.cs rename to csharp/Facebook.Yoga/Native.cs index 7e910732..b5120822 100644 --- a/csharp/Facebook.CSSLayout/Native.cs +++ b/csharp/Facebook.Yoga/Native.cs @@ -10,19 +10,19 @@ using System; using System.Runtime.InteropServices; -namespace Facebook.CSSLayout +namespace Facebook.Yoga { internal static class Native { #if UNITY_IOS && !UNITY_EDITOR private const string DllName = "__Internal"; #else - private const string DllName = "CSSLayout"; + private const string DllName = "yoga"; #endif [DllImport(DllName)] - public static extern void CSSInteropSetLogger( - [MarshalAs(UnmanagedType.FunctionPtr)] CSSLogger.Func func); + public static extern void YGInteropSetLogger( + [MarshalAs(UnmanagedType.FunctionPtr)] YogaLogger.Func func); [DllImport(DllName)] public static extern IntPtr CSSNodeNew(); @@ -94,11 +94,11 @@ namespace Facebook.CSSLayout [DllImport(DllName)] public static extern void CSSNodeSetMeasureFunc( IntPtr node, - [MarshalAs(UnmanagedType.FunctionPtr)] CSSMeasureFunc measureFunc); + [MarshalAs(UnmanagedType.FunctionPtr)] YogaMeasureFunc measureFunc); [DllImport(DllName)] [return: MarshalAs(UnmanagedType.FunctionPtr)] - public static extern CSSMeasureFunc CSSNodeGetMeasureFunc(IntPtr node); + public static extern YogaMeasureFunc CSSNodeGetMeasureFunc(IntPtr node); [DllImport(DllName)] public static extern void CSSNodeSetHasNewLayout(IntPtr node, [MarshalAs(UnmanagedType.I1)] bool hasNewLayout); diff --git a/csharp/Facebook.CSSLayout/Properties/AssemblyInfo.cs b/csharp/Facebook.Yoga/Properties/AssemblyInfo.cs similarity index 96% rename from csharp/Facebook.CSSLayout/Properties/AssemblyInfo.cs rename to csharp/Facebook.Yoga/Properties/AssemblyInfo.cs index 95d38201..bc0b9929 100644 --- a/csharp/Facebook.CSSLayout/Properties/AssemblyInfo.cs +++ b/csharp/Facebook.Yoga/Properties/AssemblyInfo.cs @@ -16,7 +16,7 @@ using System.Runtime.InteropServices; // associated with an assembly. [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Facebook, Inc.")] -[assembly: AssemblyProduct("Facebook.CSSLayout")] +[assembly: AssemblyProduct("Facebook.Yoga")] [assembly: AssemblyTrademark("Copyright (c) 2014-present, Facebook, Inc.")] // Setting ComVisible to false makes the types in this assembly not visible diff --git a/csharp/Facebook.CSSLayout/Spacing.cs b/csharp/Facebook.Yoga/Spacing.cs similarity index 96% rename from csharp/Facebook.CSSLayout/Spacing.cs rename to csharp/Facebook.Yoga/Spacing.cs index b3cee58c..c1c53c96 100644 --- a/csharp/Facebook.CSSLayout/Spacing.cs +++ b/csharp/Facebook.Yoga/Spacing.cs @@ -7,7 +7,7 @@ * of patent rights can be found in the PATENTS file in the same directory. */ -namespace Facebook.CSSLayout +namespace Facebook.Yoga { public class Spacing { diff --git a/csharp/Facebook.CSSLayout/YogaAlign.cs b/csharp/Facebook.Yoga/YogaAlign.cs similarity index 93% rename from csharp/Facebook.CSSLayout/YogaAlign.cs rename to csharp/Facebook.Yoga/YogaAlign.cs index 64932253..80835d73 100644 --- a/csharp/Facebook.CSSLayout/YogaAlign.cs +++ b/csharp/Facebook.Yoga/YogaAlign.cs @@ -7,7 +7,7 @@ * of patent rights can be found in the PATENTS file in the same directory. */ -namespace Facebook.CSSLayout +namespace Facebook.Yoga { public enum YogaAlign { diff --git a/csharp/Facebook.CSSLayout/YogaConstants.cs b/csharp/Facebook.Yoga/YogaConstants.cs similarity index 94% rename from csharp/Facebook.CSSLayout/YogaConstants.cs rename to csharp/Facebook.Yoga/YogaConstants.cs index b7fa3399..3e12aa14 100644 --- a/csharp/Facebook.CSSLayout/YogaConstants.cs +++ b/csharp/Facebook.Yoga/YogaConstants.cs @@ -7,7 +7,7 @@ * of patent rights can be found in the PATENTS file in the same directory. */ -namespace Facebook.CSSLayout +namespace Facebook.Yoga { public static class YogaConstants { diff --git a/csharp/Facebook.CSSLayout/YogaDimension.cs b/csharp/Facebook.Yoga/YogaDimension.cs similarity index 93% rename from csharp/Facebook.CSSLayout/YogaDimension.cs rename to csharp/Facebook.Yoga/YogaDimension.cs index dd167359..2b011c9d 100644 --- a/csharp/Facebook.CSSLayout/YogaDimension.cs +++ b/csharp/Facebook.Yoga/YogaDimension.cs @@ -7,7 +7,7 @@ * of patent rights can be found in the PATENTS file in the same directory. */ -namespace Facebook.CSSLayout +namespace Facebook.Yoga { public enum YogaDimension { diff --git a/csharp/Facebook.CSSLayout/YogaDirection.cs b/csharp/Facebook.Yoga/YogaDirection.cs similarity index 93% rename from csharp/Facebook.CSSLayout/YogaDirection.cs rename to csharp/Facebook.Yoga/YogaDirection.cs index 4f1317b6..000e37a7 100644 --- a/csharp/Facebook.CSSLayout/YogaDirection.cs +++ b/csharp/Facebook.Yoga/YogaDirection.cs @@ -7,7 +7,7 @@ * of patent rights can be found in the PATENTS file in the same directory. */ -namespace Facebook.CSSLayout +namespace Facebook.Yoga { public enum YogaDirection { diff --git a/csharp/Facebook.CSSLayout/YogaEdge.cs b/csharp/Facebook.Yoga/YogaEdge.cs similarity index 94% rename from csharp/Facebook.CSSLayout/YogaEdge.cs rename to csharp/Facebook.Yoga/YogaEdge.cs index 15a7ef75..aaed3d30 100644 --- a/csharp/Facebook.CSSLayout/YogaEdge.cs +++ b/csharp/Facebook.Yoga/YogaEdge.cs @@ -7,7 +7,7 @@ * of patent rights can be found in the PATENTS file in the same directory. */ -namespace Facebook.CSSLayout +namespace Facebook.Yoga { public enum YogaEdge { diff --git a/csharp/Facebook.CSSLayout/YogaExperimentalFeature.cs b/csharp/Facebook.Yoga/YogaExperimentalFeature.cs similarity index 93% rename from csharp/Facebook.CSSLayout/YogaExperimentalFeature.cs rename to csharp/Facebook.Yoga/YogaExperimentalFeature.cs index b5b09f3a..0f8156cb 100644 --- a/csharp/Facebook.CSSLayout/YogaExperimentalFeature.cs +++ b/csharp/Facebook.Yoga/YogaExperimentalFeature.cs @@ -7,7 +7,7 @@ * of patent rights can be found in the PATENTS file in the same directory. */ -namespace Facebook.CSSLayout +namespace Facebook.Yoga { public enum YogaExperimentalFeature { diff --git a/csharp/Facebook.CSSLayout/YogaFlexDirection.cs b/csharp/Facebook.Yoga/YogaFlexDirection.cs similarity index 93% rename from csharp/Facebook.CSSLayout/YogaFlexDirection.cs rename to csharp/Facebook.Yoga/YogaFlexDirection.cs index d02eeaa9..385a2884 100644 --- a/csharp/Facebook.CSSLayout/YogaFlexDirection.cs +++ b/csharp/Facebook.Yoga/YogaFlexDirection.cs @@ -7,7 +7,7 @@ * of patent rights can be found in the PATENTS file in the same directory. */ -namespace Facebook.CSSLayout +namespace Facebook.Yoga { public enum YogaFlexDirection { diff --git a/csharp/Facebook.CSSLayout/YogaJustify.cs b/csharp/Facebook.Yoga/YogaJustify.cs similarity index 93% rename from csharp/Facebook.CSSLayout/YogaJustify.cs rename to csharp/Facebook.Yoga/YogaJustify.cs index a8a3d3a1..9f1e9163 100644 --- a/csharp/Facebook.CSSLayout/YogaJustify.cs +++ b/csharp/Facebook.Yoga/YogaJustify.cs @@ -7,7 +7,7 @@ * of patent rights can be found in the PATENTS file in the same directory. */ -namespace Facebook.CSSLayout +namespace Facebook.Yoga { public enum YogaJustify { diff --git a/csharp/Facebook.CSSLayout/YogaLogLevel.cs b/csharp/Facebook.Yoga/YogaLogLevel.cs similarity index 93% rename from csharp/Facebook.CSSLayout/YogaLogLevel.cs rename to csharp/Facebook.Yoga/YogaLogLevel.cs index 89fce541..ce41ba48 100644 --- a/csharp/Facebook.CSSLayout/YogaLogLevel.cs +++ b/csharp/Facebook.Yoga/YogaLogLevel.cs @@ -7,7 +7,7 @@ * of patent rights can be found in the PATENTS file in the same directory. */ -namespace Facebook.CSSLayout +namespace Facebook.Yoga { public enum YogaLogLevel { diff --git a/csharp/Facebook.CSSLayout/CSSLogger.cs b/csharp/Facebook.Yoga/YogaLogger.cs similarity index 90% rename from csharp/Facebook.CSSLayout/CSSLogger.cs rename to csharp/Facebook.Yoga/YogaLogger.cs index 16718deb..e5d79b79 100644 --- a/csharp/Facebook.CSSLayout/CSSLogger.cs +++ b/csharp/Facebook.Yoga/YogaLogger.cs @@ -10,9 +10,9 @@ using System; using System.Runtime.InteropServices; -namespace Facebook.CSSLayout +namespace Facebook.Yoga { - internal static class CSSLogger + internal static class YogaLogger { [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate void Func(YogaLogLevel level, string message); @@ -37,7 +37,7 @@ namespace Facebook.CSSLayout throw new InvalidOperationException(message); } }; - Native.CSSInteropSetLogger(_managedLogger); + Native.YGInteropSetLogger(_managedLogger); _initialized = true; } } diff --git a/csharp/Facebook.CSSLayout/CSSMeasureFunc.cs b/csharp/Facebook.Yoga/YogaMeasureFunc.cs similarity index 88% rename from csharp/Facebook.CSSLayout/CSSMeasureFunc.cs rename to csharp/Facebook.Yoga/YogaMeasureFunc.cs index 6864c280..0474292a 100644 --- a/csharp/Facebook.CSSLayout/CSSMeasureFunc.cs +++ b/csharp/Facebook.Yoga/YogaMeasureFunc.cs @@ -10,10 +10,10 @@ using System; using System.Runtime.InteropServices; -namespace Facebook.CSSLayout +namespace Facebook.Yoga { [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate CSSSize CSSMeasureFunc( + public delegate YogaSize YogaMeasureFunc( IntPtr node, float width, YogaMeasureMode widthMode, diff --git a/csharp/Facebook.CSSLayout/YogaMeasureMode.cs b/csharp/Facebook.Yoga/YogaMeasureMode.cs similarity index 93% rename from csharp/Facebook.CSSLayout/YogaMeasureMode.cs rename to csharp/Facebook.Yoga/YogaMeasureMode.cs index 28d837f3..f044b266 100644 --- a/csharp/Facebook.CSSLayout/YogaMeasureMode.cs +++ b/csharp/Facebook.Yoga/YogaMeasureMode.cs @@ -7,7 +7,7 @@ * of patent rights can be found in the PATENTS file in the same directory. */ -namespace Facebook.CSSLayout +namespace Facebook.Yoga { public enum YogaMeasureMode { diff --git a/csharp/Facebook.CSSLayout/CSSNode.Create.cs b/csharp/Facebook.Yoga/YogaNode.Create.cs similarity index 84% rename from csharp/Facebook.CSSLayout/CSSNode.Create.cs rename to csharp/Facebook.Yoga/YogaNode.Create.cs index 31a52c85..a7df02d0 100644 --- a/csharp/Facebook.CSSLayout/CSSNode.Create.cs +++ b/csharp/Facebook.Yoga/YogaNode.Create.cs @@ -9,11 +9,11 @@ using System; -namespace Facebook.CSSLayout +namespace Facebook.Yoga { - public partial class CSSNode + public partial class YogaNode { - public static CSSNode Create( + public static YogaNode Create( YogaDirection? styleDirection = null, YogaFlexDirection? flexDirection = null, YogaJustify? justifyContent = null, @@ -31,15 +31,14 @@ namespace Facebook.CSSLayout Spacing margin = null, Spacing padding = null, Spacing border = null, - float? width = null, - float? height = null, - float? maxWidth = null, - float? maxHeight = null, - float? minWidth = null, - float? minHeight = null, - float? aspectRatio = null) + float? Width = null, + float? Height = null, + float? MaxWidth = null, + float? MaxHeight = null, + float? MinWidth = null, + float? MinHeight = null) { - CSSNode node = new CSSNode(); + YogaNode node = new YogaNode(); if (styleDirection.HasValue) { @@ -198,39 +197,34 @@ namespace Facebook.CSSLayout } } - if (width.HasValue) + if (Width.HasValue) { - node.Width = width.Value; + node.Width = Width.Value; } - if (height.HasValue) + if (Height.HasValue) { - node.Height = height.Value; + node.Height = Height.Value; } - if (minWidth.HasValue) + if (MinWidth.HasValue) { - node.MinWidth = minWidth.Value; + node.MinWidth = MinWidth.Value; } - if (minHeight.HasValue) + if (MinHeight.HasValue) { - node.MinHeight = minHeight.Value; + node.MinHeight = MinHeight.Value; } - if (maxWidth.HasValue) + if (MaxWidth.HasValue) { - node.MaxWidth = maxWidth.Value; + node.MaxWidth = MaxWidth.Value; } - if (maxHeight.HasValue) + if (MaxHeight.HasValue) { - node.MaxHeight = maxHeight.Value; - } - - if (aspectRatio.HasValue) - { - node.AspectRatio = aspectRatio.Value; + node.MaxHeight = MaxHeight.Value; } return node; diff --git a/csharp/Facebook.CSSLayout/CSSNode.cs b/csharp/Facebook.Yoga/YogaNode.cs similarity index 90% rename from csharp/Facebook.CSSLayout/CSSNode.cs rename to csharp/Facebook.Yoga/YogaNode.cs index 73694f6f..8d1b5a6b 100644 --- a/csharp/Facebook.CSSLayout/CSSNode.cs +++ b/csharp/Facebook.Yoga/YogaNode.cs @@ -13,20 +13,20 @@ using System.Collections.Generic; using System.Runtime.InteropServices; using System.Text; -namespace Facebook.CSSLayout +namespace Facebook.Yoga { - public partial class CSSNode : IEnumerable + public partial class YogaNode : IEnumerable { private IntPtr _cssNode; private WeakReference _parent; - private List _children; + private List _children; private MeasureFunction _measureFunction; - private CSSMeasureFunc _cssMeasureFunc; + private YogaMeasureFunc _cssMeasureFunc; private object _data; - public CSSNode() + public YogaNode() { - CSSLogger.Initialize(); + YogaLogger.Initialize(); _cssNode = Native.CSSNodeNew(); if (_cssNode == IntPtr.Zero) @@ -35,7 +35,7 @@ namespace Facebook.CSSLayout } } - ~CSSNode() + ~YogaNode() { Native.CSSNodeFree(_cssNode); } @@ -74,11 +74,11 @@ namespace Facebook.CSSLayout Native.CSSNodeSetHasNewLayout(_cssNode, true); } - public CSSNode Parent + public YogaNode Parent { get { - return _parent != null ? _parent.Target as CSSNode : null; + return _parent != null ? _parent.Target as YogaNode : null; } } @@ -90,7 +90,7 @@ namespace Facebook.CSSLayout } } - public void CopyStyle(CSSNode srcNode) + public void CopyStyle(YogaNode srcNode) { Native.CSSNodeCopyStyle(_cssNode, srcNode._cssNode); } @@ -364,7 +364,7 @@ namespace Facebook.CSSLayout } } - public float AspectRatio + public float StyleAspectRatio { get { @@ -443,7 +443,7 @@ namespace Facebook.CSSLayout } } - public CSSNode this[int index] + public YogaNode this[int index] { get { @@ -474,11 +474,11 @@ namespace Facebook.CSSLayout return Math.Abs(f2 - f1) < float.Epsilon; } - public void Insert(int index, CSSNode node) + public void Insert(int index, YogaNode node) { if (_children == null) { - _children = new List(4); + _children = new List(4); } _children.Insert(index, node); node._parent = new WeakReference(this); @@ -504,7 +504,7 @@ namespace Facebook.CSSLayout } } - public int IndexOf(CSSNode node) + public int IndexOf(YogaNode node) { return _children != null ? _children.IndexOf(node) : -1; } @@ -512,7 +512,7 @@ namespace Facebook.CSSLayout public void SetMeasureFunction(MeasureFunction measureFunction) { _measureFunction = measureFunction; - _cssMeasureFunc = measureFunction != null ? MeasureInternal : (CSSMeasureFunc)null; + _cssMeasureFunc = measureFunction != null ? MeasureInternal : (YogaMeasureFunc)null; Native.CSSNodeSetMeasureFunc(_cssNode, _cssMeasureFunc); } @@ -525,7 +525,7 @@ namespace Facebook.CSSLayout Native.CSSNodeStyleGetDirection(_cssNode)); } - private CSSSize MeasureInternal( + private YogaSize MeasureInternal( IntPtr node, float width, YogaMeasureMode widthMode, @@ -538,30 +538,30 @@ namespace Facebook.CSSLayout } long output = _measureFunction(this, width, widthMode, height, heightMode); - return new CSSSize { width = MeasureOutput.GetWidth(output), height = MeasureOutput.GetHeight(output) }; + return new YogaSize { width = MeasureOutput.GetWidth(output), height = MeasureOutput.GetHeight(output) }; } public string Print(YogaPrintOptions options = YogaPrintOptions.Layout|YogaPrintOptions.Style|YogaPrintOptions.Children) { StringBuilder sb = new StringBuilder(); - CSSLogger.Func orig = CSSLogger.Logger; - CSSLogger.Logger = (level, message) => {sb.Append(message);}; + YogaLogger.Func orig = YogaLogger.Logger; + YogaLogger.Logger = (level, message) => {sb.Append(message);}; Native.CSSNodePrint(_cssNode, options); - CSSLogger.Logger = orig; + YogaLogger.Logger = orig; return sb.ToString(); } - public IEnumerator GetEnumerator() + public IEnumerator GetEnumerator() { - return _children != null ? ((IEnumerable)_children).GetEnumerator() : - System.Linq.Enumerable.Empty().GetEnumerator(); + return _children != null ? ((IEnumerable)_children).GetEnumerator() : + System.Linq.Enumerable.Empty().GetEnumerator(); } IEnumerator IEnumerable.GetEnumerator() { - return _children != null ? ((IEnumerable)_children).GetEnumerator() : - System.Linq.Enumerable.Empty().GetEnumerator(); + return _children != null ? ((IEnumerable)_children).GetEnumerator() : + System.Linq.Enumerable.Empty().GetEnumerator(); } public static int GetInstanceCount() diff --git a/csharp/Facebook.CSSLayout/YogaOverflow.cs b/csharp/Facebook.Yoga/YogaOverflow.cs similarity index 93% rename from csharp/Facebook.CSSLayout/YogaOverflow.cs rename to csharp/Facebook.Yoga/YogaOverflow.cs index 89bef500..29b2a5de 100644 --- a/csharp/Facebook.CSSLayout/YogaOverflow.cs +++ b/csharp/Facebook.Yoga/YogaOverflow.cs @@ -7,7 +7,7 @@ * of patent rights can be found in the PATENTS file in the same directory. */ -namespace Facebook.CSSLayout +namespace Facebook.Yoga { public enum YogaOverflow { diff --git a/csharp/Facebook.CSSLayout/YogaPositionType.cs b/csharp/Facebook.Yoga/YogaPositionType.cs similarity index 93% rename from csharp/Facebook.CSSLayout/YogaPositionType.cs rename to csharp/Facebook.Yoga/YogaPositionType.cs index 7f76b6a3..8225b3f4 100644 --- a/csharp/Facebook.CSSLayout/YogaPositionType.cs +++ b/csharp/Facebook.Yoga/YogaPositionType.cs @@ -7,7 +7,7 @@ * of patent rights can be found in the PATENTS file in the same directory. */ -namespace Facebook.CSSLayout +namespace Facebook.Yoga { public enum YogaPositionType { diff --git a/csharp/Facebook.CSSLayout/YogaPrintOptions.cs b/csharp/Facebook.Yoga/YogaPrintOptions.cs similarity index 93% rename from csharp/Facebook.CSSLayout/YogaPrintOptions.cs rename to csharp/Facebook.Yoga/YogaPrintOptions.cs index a52f38e8..be3723f0 100644 --- a/csharp/Facebook.CSSLayout/YogaPrintOptions.cs +++ b/csharp/Facebook.Yoga/YogaPrintOptions.cs @@ -7,7 +7,7 @@ * of patent rights can be found in the PATENTS file in the same directory. */ -namespace Facebook.CSSLayout +namespace Facebook.Yoga { public enum YogaPrintOptions { diff --git a/csharp/Facebook.CSSLayout/CSSSize.cs b/csharp/Facebook.Yoga/YogaSize.cs similarity index 89% rename from csharp/Facebook.CSSLayout/CSSSize.cs rename to csharp/Facebook.Yoga/YogaSize.cs index 5fd3a291..d46f82fb 100644 --- a/csharp/Facebook.CSSLayout/CSSSize.cs +++ b/csharp/Facebook.Yoga/YogaSize.cs @@ -9,10 +9,10 @@ using System.Runtime.InteropServices; -namespace Facebook.CSSLayout +namespace Facebook.Yoga { [StructLayout(LayoutKind.Sequential)] - public struct CSSSize + public struct YogaSize { public float width; public float height; diff --git a/csharp/Facebook.CSSLayout/YogaWrap.cs b/csharp/Facebook.Yoga/YogaWrap.cs similarity index 92% rename from csharp/Facebook.CSSLayout/YogaWrap.cs rename to csharp/Facebook.Yoga/YogaWrap.cs index df6d30bb..3d88ad04 100644 --- a/csharp/Facebook.CSSLayout/YogaWrap.cs +++ b/csharp/Facebook.Yoga/YogaWrap.cs @@ -7,7 +7,7 @@ * of patent rights can be found in the PATENTS file in the same directory. */ -namespace Facebook.CSSLayout +namespace Facebook.Yoga { public enum YogaWrap { diff --git a/csharp/Facebook.CSSLayout/project.json b/csharp/Facebook.Yoga/project.json similarity index 100% rename from csharp/Facebook.CSSLayout/project.json rename to csharp/Facebook.Yoga/project.json diff --git a/csharp/CSSLayout/CSSInterop.cpp b/csharp/Yoga/YGInterop.cpp similarity index 83% rename from csharp/CSSLayout/CSSInterop.cpp rename to csharp/Yoga/YGInterop.cpp index 7995cab2..04c849cd 100644 --- a/csharp/CSSLayout/CSSInterop.cpp +++ b/csharp/Yoga/YGInterop.cpp @@ -7,9 +7,9 @@ * of patent rights can be found in the PATENTS file in the same directory. */ -#include "CSSInterop.h" +#include "YGInterop.h" -static CSSInteropLoggerFunc gManagedFunc; +static YGInteropLoggerFunc gManagedFunc; static int unmanagedLogger(YGLogLevel level, const char *format, va_list args) { int result = 0; @@ -21,7 +21,7 @@ static int unmanagedLogger(YGLogLevel level, const char *format, va_list args) { return result; } -void CSSInteropSetLogger(CSSInteropLoggerFunc managedFunc) { +void YGInteropSetLogger(YGInteropLoggerFunc managedFunc) { gManagedFunc = managedFunc; CSSLayoutSetLogger(&unmanagedLogger); } diff --git a/csharp/CSSLayout/CSSInterop.h b/csharp/Yoga/YGInterop.h similarity index 72% rename from csharp/CSSLayout/CSSInterop.h rename to csharp/Yoga/YGInterop.h index daa82247..546bf46b 100644 --- a/csharp/CSSLayout/CSSInterop.h +++ b/csharp/Yoga/YGInterop.h @@ -13,8 +13,8 @@ CSS_EXTERN_C_BEGIN -typedef void (*CSSInteropLoggerFunc)(YGLogLevel level, const char *message); +typedef void (*YGInteropLoggerFunc)(YGLogLevel level, const char *message); -WIN_EXPORT void CSSInteropSetLogger(CSSInteropLoggerFunc managedFunc); +WIN_EXPORT void YGInteropSetLogger(YGInteropLoggerFunc managedFunc); CSS_EXTERN_C_END diff --git a/csharp/CSSLayout/CSSLayout.vcxproj b/csharp/Yoga/Yoga.vcxproj similarity index 96% rename from csharp/CSSLayout/CSSLayout.vcxproj rename to csharp/Yoga/Yoga.vcxproj index 199eb3e8..b6029218 100755 --- a/csharp/CSSLayout/CSSLayout.vcxproj +++ b/csharp/Yoga/Yoga.vcxproj @@ -21,7 +21,7 @@ {0446C86B-F47B-4C46-B673-C7AE0CFF35D5} Win32Proj - CSSLayout + Yoga 10.0.14393.0 @@ -153,14 +153,14 @@ - + - + false @@ -180,4 +180,4 @@ - \ No newline at end of file + diff --git a/csharp/CSSLayout/CSSLayout.vcxproj.filters b/csharp/Yoga/Yoga.vcxproj.filters similarity index 95% rename from csharp/CSSLayout/CSSLayout.vcxproj.filters rename to csharp/Yoga/Yoga.vcxproj.filters index 07197766..65c4b19c 100755 --- a/csharp/CSSLayout/CSSLayout.vcxproj.filters +++ b/csharp/Yoga/Yoga.vcxproj.filters @@ -30,7 +30,7 @@ Header Files - + Header Files @@ -47,8 +47,8 @@ Source Files - + Source Files - \ No newline at end of file + diff --git a/csharp/CSSLayout/dllmain.cpp b/csharp/Yoga/dllmain.cpp similarity index 100% rename from csharp/CSSLayout/dllmain.cpp rename to csharp/Yoga/dllmain.cpp diff --git a/csharp/CSSLayout/stdafx.cpp b/csharp/Yoga/stdafx.cpp similarity index 91% rename from csharp/CSSLayout/stdafx.cpp rename to csharp/Yoga/stdafx.cpp index 53e7c346..cdee8426 100644 --- a/csharp/CSSLayout/stdafx.cpp +++ b/csharp/Yoga/stdafx.cpp @@ -8,7 +8,7 @@ */ // stdafx.cpp : source file that includes just the standard includes -// CSSLayout.pch will be the pre-compiled header +// Yoga.pch will be the pre-compiled header // stdafx.obj will contain the pre-compiled type information #include "stdafx.h" diff --git a/csharp/CSSLayout/stdafx.h b/csharp/Yoga/stdafx.h similarity index 100% rename from csharp/CSSLayout/stdafx.h rename to csharp/Yoga/stdafx.h diff --git a/csharp/CSSLayout/targetver.h b/csharp/Yoga/targetver.h similarity index 100% rename from csharp/CSSLayout/targetver.h rename to csharp/Yoga/targetver.h diff --git a/csharp/tests/Facebook.CSSLayout/CSSLayoutAbsolutePositionTest.cs b/csharp/tests/Facebook.Yoga/CSSLayoutAbsolutePositionTest.cs similarity index 94% rename from csharp/tests/Facebook.CSSLayout/CSSLayoutAbsolutePositionTest.cs rename to csharp/tests/Facebook.Yoga/CSSLayoutAbsolutePositionTest.cs index d058942c..ba377250 100644 --- a/csharp/tests/Facebook.CSSLayout/CSSLayoutAbsolutePositionTest.cs +++ b/csharp/tests/Facebook.Yoga/CSSLayoutAbsolutePositionTest.cs @@ -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); diff --git a/csharp/tests/Facebook.CSSLayout/CSSLayoutAlignContentTest.cs b/csharp/tests/Facebook.Yoga/CSSLayoutAlignContentTest.cs similarity index 92% rename from csharp/tests/Facebook.CSSLayout/CSSLayoutAlignContentTest.cs rename to csharp/tests/Facebook.Yoga/CSSLayoutAlignContentTest.cs index c17d2b0a..2fd26b95 100644 --- a/csharp/tests/Facebook.CSSLayout/CSSLayoutAlignContentTest.cs +++ b/csharp/tests/Facebook.Yoga/CSSLayoutAlignContentTest.cs @@ -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; diff --git a/csharp/tests/Facebook.CSSLayout/CSSLayoutAlignItemsTest.cs b/csharp/tests/Facebook.Yoga/CSSLayoutAlignItemsTest.cs similarity index 93% rename from csharp/tests/Facebook.CSSLayout/CSSLayoutAlignItemsTest.cs rename to csharp/tests/Facebook.Yoga/CSSLayoutAlignItemsTest.cs index cf2ac0ed..54101754 100644 --- a/csharp/tests/Facebook.CSSLayout/CSSLayoutAlignItemsTest.cs +++ b/csharp/tests/Facebook.Yoga/CSSLayoutAlignItemsTest.cs @@ -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); diff --git a/csharp/tests/Facebook.CSSLayout/CSSLayoutAlignSelfTest.cs b/csharp/tests/Facebook.Yoga/CSSLayoutAlignSelfTest.cs similarity index 93% rename from csharp/tests/Facebook.CSSLayout/CSSLayoutAlignSelfTest.cs rename to csharp/tests/Facebook.Yoga/CSSLayoutAlignSelfTest.cs index c7fdc958..00a8246f 100644 --- a/csharp/tests/Facebook.CSSLayout/CSSLayoutAlignSelfTest.cs +++ b/csharp/tests/Facebook.Yoga/CSSLayoutAlignSelfTest.cs @@ -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; diff --git a/csharp/tests/Facebook.CSSLayout/CSSLayoutBorderTest.cs b/csharp/tests/Facebook.Yoga/CSSLayoutBorderTest.cs similarity index 94% rename from csharp/tests/Facebook.CSSLayout/CSSLayoutBorderTest.cs rename to csharp/tests/Facebook.Yoga/CSSLayoutBorderTest.cs index fab4b731..1182b777 100644 --- a/csharp/tests/Facebook.CSSLayout/CSSLayoutBorderTest.cs +++ b/csharp/tests/Facebook.Yoga/CSSLayoutBorderTest.cs @@ -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); diff --git a/csharp/tests/Facebook.CSSLayout/CSSLayoutFlexDirectionTest.cs b/csharp/tests/Facebook.Yoga/CSSLayoutFlexDirectionTest.cs similarity index 92% rename from csharp/tests/Facebook.CSSLayout/CSSLayoutFlexDirectionTest.cs rename to csharp/tests/Facebook.Yoga/CSSLayoutFlexDirectionTest.cs index 81d639b0..abd749b7 100644 --- a/csharp/tests/Facebook.CSSLayout/CSSLayoutFlexDirectionTest.cs +++ b/csharp/tests/Facebook.Yoga/CSSLayoutFlexDirectionTest.cs @@ -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; diff --git a/csharp/tests/Facebook.CSSLayout/CSSLayoutFlexTest.cs b/csharp/tests/Facebook.Yoga/CSSLayoutFlexTest.cs similarity index 92% rename from csharp/tests/Facebook.CSSLayout/CSSLayoutFlexTest.cs rename to csharp/tests/Facebook.Yoga/CSSLayoutFlexTest.cs index 995eec52..69ee52a1 100644 --- a/csharp/tests/Facebook.CSSLayout/CSSLayoutFlexTest.cs +++ b/csharp/tests/Facebook.Yoga/CSSLayoutFlexTest.cs @@ -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); diff --git a/csharp/tests/Facebook.CSSLayout/CSSLayoutFlexWrapTest.cs b/csharp/tests/Facebook.Yoga/CSSLayoutFlexWrapTest.cs similarity index 92% rename from csharp/tests/Facebook.CSSLayout/CSSLayoutFlexWrapTest.cs rename to csharp/tests/Facebook.Yoga/CSSLayoutFlexWrapTest.cs index 7ea50ec3..bf8c4ac8 100644 --- a/csharp/tests/Facebook.CSSLayout/CSSLayoutFlexWrapTest.cs +++ b/csharp/tests/Facebook.Yoga/CSSLayoutFlexWrapTest.cs @@ -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); diff --git a/csharp/tests/Facebook.CSSLayout/CSSLayoutJustifyContentTest.cs b/csharp/tests/Facebook.Yoga/CSSLayoutJustifyContentTest.cs similarity index 92% rename from csharp/tests/Facebook.CSSLayout/CSSLayoutJustifyContentTest.cs rename to csharp/tests/Facebook.Yoga/CSSLayoutJustifyContentTest.cs index 1a2a3ea7..86d8d50f 100644 --- a/csharp/tests/Facebook.CSSLayout/CSSLayoutJustifyContentTest.cs +++ b/csharp/tests/Facebook.Yoga/CSSLayoutJustifyContentTest.cs @@ -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; diff --git a/csharp/tests/Facebook.CSSLayout/CSSLayoutMarginTest.cs b/csharp/tests/Facebook.Yoga/CSSLayoutMarginTest.cs similarity index 93% rename from csharp/tests/Facebook.CSSLayout/CSSLayoutMarginTest.cs rename to csharp/tests/Facebook.Yoga/CSSLayoutMarginTest.cs index e6030df8..c2eb8123 100644 --- a/csharp/tests/Facebook.CSSLayout/CSSLayoutMarginTest.cs +++ b/csharp/tests/Facebook.Yoga/CSSLayoutMarginTest.cs @@ -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; diff --git a/csharp/tests/Facebook.CSSLayout/CSSLayoutMinMaxDimensionTest.cs b/csharp/tests/Facebook.Yoga/CSSLayoutMinMaxDimensionTest.cs similarity index 93% rename from csharp/tests/Facebook.CSSLayout/CSSLayoutMinMaxDimensionTest.cs rename to csharp/tests/Facebook.Yoga/CSSLayoutMinMaxDimensionTest.cs index dcfa7f1a..6d8b7ba9 100644 --- a/csharp/tests/Facebook.CSSLayout/CSSLayoutMinMaxDimensionTest.cs +++ b/csharp/tests/Facebook.Yoga/CSSLayoutMinMaxDimensionTest.cs @@ -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); diff --git a/csharp/tests/Facebook.CSSLayout/CSSLayoutPaddingTest.cs b/csharp/tests/Facebook.Yoga/CSSLayoutPaddingTest.cs similarity index 94% rename from csharp/tests/Facebook.CSSLayout/CSSLayoutPaddingTest.cs rename to csharp/tests/Facebook.Yoga/CSSLayoutPaddingTest.cs index c9ec0ae6..47f04155 100644 --- a/csharp/tests/Facebook.CSSLayout/CSSLayoutPaddingTest.cs +++ b/csharp/tests/Facebook.Yoga/CSSLayoutPaddingTest.cs @@ -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); diff --git a/csharp/tests/Facebook.CSSLayout/CSSLayoutRoundingTest.cs b/csharp/tests/Facebook.Yoga/CSSLayoutRoundingTest.cs similarity index 87% rename from csharp/tests/Facebook.CSSLayout/CSSLayoutRoundingTest.cs rename to csharp/tests/Facebook.Yoga/CSSLayoutRoundingTest.cs index 36b255de..570b00be 100644 --- a/csharp/tests/Facebook.CSSLayout/CSSLayoutRoundingTest.cs +++ b/csharp/tests/Facebook.Yoga/CSSLayoutRoundingTest.cs @@ -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); } } diff --git a/csharp/tests/Facebook.CSSLayout/CSSNodeCreateTest.cs b/csharp/tests/Facebook.Yoga/YogaNodeCreateTest.cs similarity index 89% rename from csharp/tests/Facebook.CSSLayout/CSSNodeCreateTest.cs rename to csharp/tests/Facebook.Yoga/YogaNodeCreateTest.cs index e2e8363d..d7cd8d8e 100644 --- a/csharp/tests/Facebook.CSSLayout/CSSNodeCreateTest.cs +++ b/csharp/tests/Facebook.Yoga/YogaNodeCreateTest.cs @@ -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); diff --git a/csharp/tests/Facebook.CSSLayout/CSSNodeTest.cs b/csharp/tests/Facebook.Yoga/YogaNodeTest.cs similarity index 65% rename from csharp/tests/Facebook.CSSLayout/CSSNodeTest.cs rename to csharp/tests/Facebook.Yoga/YogaNodeTest.cs index 42e83d39..5cf1002b 100644 --- a/csharp/tests/Facebook.CSSLayout/CSSNodeTest.cs +++ b/csharp/tests/Facebook.Yoga/YogaNodeTest.cs @@ -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); diff --git a/csharp/tests/Facebook.CSSLayout/test_macos.sh b/csharp/tests/Facebook.Yoga/test_macos.sh similarity index 80% rename from csharp/tests/Facebook.CSSLayout/test_macos.sh rename to csharp/tests/Facebook.Yoga/test_macos.sh index 566170e4..9a3ad14f 100755 --- a/csharp/tests/Facebook.CSSLayout/test_macos.sh +++ b/csharp/tests/Facebook.Yoga/test_macos.sh @@ -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 diff --git a/enums.py b/enums.py index e54e49d6..8360da49 100644 --- a/enums.py +++ b/enums.py @@ -175,9 +175,9 @@ for name, values in ENUMS.items(): # write out csharp files for name, values in ENUMS.items(): - with open(root + '/csharp/Facebook.CSSLayout/Yoga%s.cs' % name, 'w') as f: + with open(root + '/csharp/Facebook.Yoga/Yoga%s.cs' % name, 'w') as f: f.write(LICENSE) - f.write('namespace Facebook.CSSLayout\n{\n') + f.write('namespace Facebook.Yoga\n{\n') f.write(' public enum Yoga%s\n {\n' % name) for value in values: if isinstance(value, tuple): diff --git a/gentest/gentest-cs.js b/gentest/gentest-cs.js index 49c8e7cd..32a36173 100644 --- a/gentest/gentest-cs.js +++ b/gentest/gentest-cs.js @@ -19,13 +19,13 @@ CSEmitter.prototype = Object.create(Emitter.prototype, { 'using System;', 'using NUnit.Framework;', '', - 'namespace Facebook.CSSLayout', + 'namespace Facebook.Yoga', '{', ]); this.pushIndent(); this.push([ '[TestFixture]', - 'public class CSSNodeLayoutTest', + 'public class YogaTest', '{', ]); this.pushIndent(); @@ -39,21 +39,21 @@ CSEmitter.prototype = Object.create(Emitter.prototype, { if (experiments.length > 0) { for (var i in experiments) { - this.push('CSSNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.' + experiments[i] +', true);'); + this.push('YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.' + experiments[i] +', true);'); } this.push(''); } }}, emitTestTreePrologue:{value:function(nodeName) { - this.push('CSSNode ' + nodeName + ' = new CSSNode();'); + this.push('YogaNode ' + nodeName + ' = new YogaNode();'); }}, emitTestEpilogue:{value:function(experiments) { if (experiments.length > 0) { this.push(''); for (var i in experiments) { - this.push('CSSNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.' + experiments[i] +', false);'); + this.push('YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.' + experiments[i] +', false);'); } } diff --git a/gentest/gentest.rb b/gentest/gentest.rb index 1ee0c78b..1d3300ac 100644 --- a/gentest/gentest.rb +++ b/gentest/gentest.rb @@ -44,8 +44,8 @@ Dir['fixtures/*.html'].each do |file| f.write eval(logs[1].message.sub(/^[^"]*/, '')).sub('CSSNodeLayoutTest', name) f.close - f = File.open("../csharp/tests/Facebook.CSSLayout/#{name}.cs", 'w') - f.write eval(logs[2].message.sub(/^[^"]*/, '')).sub('CSSNodeLayoutTest', name) + f = File.open("../csharp/tests/Facebook.Yoga/#{name}.cs", 'w') + f.write eval(logs[2].message.sub(/^[^"]*/, '')).sub('YogaTest', name) f.close end File.delete('test.html')