Esempio n. 1
0
        public void LayoutGroupMeasureChildWithoutPadding()
        {
            tlog.Debug(tag, $"LayoutGroupMeasureChildWithoutPadding START");

            var testingTarget = new MyLayoutGroup();

            Assert.IsNotNull(testingTarget, "null handle");
            Assert.IsInstanceOf <LayoutGroup>(testingTarget, "Should be an instance of LayoutGroup type.");

            View view = new View()
            {
                ExcludeLayouting = false,
                Size             = new Size(100, 150)
            };

            using (LayoutItem child = new LayoutItem())
            {
                child.AttachToOwner(view);
                testingTarget.Add(child);

                MeasureSpecification measureWidth  = new MeasureSpecification(new LayoutLength(50.0f), MeasureSpecification.ModeType.Exactly);
                MeasureSpecification measureHeight = new MeasureSpecification(new LayoutLength(50.0f), MeasureSpecification.ModeType.Exactly);

                try
                {
                    testingTarget.MeasureChildWithoutPaddingTest(child, measureWidth, measureHeight);
                }
                catch (Exception e)
                {
                    tlog.Error(tag, "Caught Exception" + e.ToString());
                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString());
                    Assert.Fail("Caught Exception" + e.ToString());
                }
            }

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