Exemple #1
0
        public void LayoutGroupRemove()
        {
            tlog.Debug(tag, $"LayoutGroupRemove START");

            var testingTarget = new MyLayoutGroup();

            Assert.IsNotNull(testingTarget, "null handle");
            Assert.IsInstanceOf <LayoutGroup>(testingTarget, "Should return LayoutGroup instance.");

            using (LayoutItem layoutItem = new LayoutItem())
            {
                testingTarget.LayoutWithTransition = true;

                testingTarget.Add(layoutItem);
                Assert.AreEqual(testingTarget.ChildCount(), 1, "Should 1 for the added child.");

                using (LayoutItem siblingLayoutItem = new LayoutItem())
                {
                    testingTarget.Add(siblingLayoutItem);
                    Assert.AreEqual(testingTarget.ChildCount(), 2, "Should 1 for the added child.");

                    testingTarget.Remove(layoutItem);
                    Assert.AreEqual(testingTarget.ChildCount(), 1, "Should 0 as child removed");
                }
            }

            testingTarget.Dispose();
            tlog.Debug(tag, $"LayoutGroupRemove END (OK)");
        }
Exemple #2
0
        public void LayoutGroupLayoutChildren()
        {
            tlog.Debug(tag, $"LayoutGroupLayoutChildren START");

            var testingTarget = new MyLayoutGroup();

            Assert.IsNotNull(testingTarget, "null handle");
            Assert.IsInstanceOf <LayoutGroup>(testingTarget, "Should return LayoutGroup instance.");

            using (LayoutItem layoutItem = new LayoutItem())
            {
                testingTarget.Add(layoutItem);
                Assert.AreEqual(1, testingTarget.ChildCount(), "Should number of children added");
            }

            testingTarget.Dispose();
            tlog.Debug(tag, $"LayoutGroupLayoutChildren END (OK)");
        }