Esempio n. 1
0
        public void TestCopyConstructor()
        {
            YogaNode srcNode = new YogaNode(new YogaConfig {
                UseWebDefaults = true
            });
            YogaNode node0 = new YogaNode(srcNode);

            Assert.AreEqual(YogaFlexDirection.Row, node0.FlexDirection);

            node0.FlexDirection = YogaFlexDirection.Column;
            Assert.AreEqual(YogaFlexDirection.Column, node0.FlexDirection);

            node0.Reset();
            Assert.AreEqual(YogaFlexDirection.Row, node0.FlexDirection);

            YogaNode node1 = new YogaNode(srcNode)
            {
                FlexDirection = YogaFlexDirection.Column
            };

            Assert.AreEqual(YogaFlexDirection.Column, node1.FlexDirection);

            node1.Reset();
            Assert.AreEqual(YogaFlexDirection.Row, node1.FlexDirection);
        }
Esempio n. 2
0
        public void TestResetChild()
        {
            YogaNode parent = new YogaNode();
            YogaNode child  = new YogaNode();

            parent.Insert(0, child);
            Assert.Throws <InvalidOperationException>(() => child.Reset());
        }
Esempio n. 3
0
        public void TestReset()
        {
            int      instanceCount = YogaNode.GetInstanceCount();
            YogaNode node          = new YogaNode();

            Assert.AreEqual(instanceCount + 1, YogaNode.GetInstanceCount());
            node.Reset();
            Assert.AreEqual(instanceCount + 1, YogaNode.GetInstanceCount());
        }
Esempio n. 4
0
        public void TestUseWebDefaults()
        {
            YogaNode node0 = new YogaNode(new YogaConfig {
                UseWebDefaults = true
            });

            Assert.AreEqual(YogaFlexDirection.Row, node0.FlexDirection);

            node0.Reset();
            Assert.AreEqual(YogaFlexDirection.Row, node0.FlexDirection);

            YogaConfig config = new YogaConfig();

            config.UseWebDefaults = true;
            YogaNode node1 = new YogaNode(config);

            Assert.AreEqual(YogaFlexDirection.Row, node1.FlexDirection);

            node1.Reset();
            Assert.AreEqual(YogaFlexDirection.Row, node1.FlexDirection);
        }