Exemplo n.º 1
0
        public void OrientationHelperGetViewHolderMeasurementInOther()
        {
            tlog.Debug(tag, $"OrientationHelperGetViewHolderMeasurementInOther START");

            FlexibleViewLayoutManager manager = new FlexibleViewLayoutManagerImpl();

            Assert.IsNotNull(manager, "should be not null");
            Assert.IsInstanceOf <FlexibleViewLayoutManager>(manager, "should be an instance of testing target class!");

            var testingTarget = new OrientationHelperImpl(manager);

            Assert.IsNotNull(testingTarget, "should be not null");
            Assert.IsInstanceOf <OrientationHelper>(testingTarget, "should be an instance of testing target class!");

            using (View view = new View()
            {
                Size = new Size(100, 200)
            })
            {
                FlexibleViewViewHolder holder = new FlexibleViewViewHolder(view);

                var result = testingTarget.GetViewHolderMeasurementInOther(holder);
                tlog.Debug(tag, "GetViewHolderMeasurementInOther : " + result);
            }

            manager.Dispose();
            tlog.Debug(tag, $"OrientationHelperGetViewHolderMeasurementInOther END (OK)");
        }
Exemplo n.º 2
0
        public void OrientationHelperGetTotalSpaceChange()
        {
            tlog.Debug(tag, $"OrientationHelperGetTotalSpaceChange START");

            FlexibleViewLayoutManager manager = new FlexibleViewLayoutManagerImpl();

            Assert.IsNotNull(manager, "should be not null");
            Assert.IsInstanceOf <FlexibleViewLayoutManager>(manager, "should be an instance of testing target class!");

            var testingTarget = new OrientationHelperImpl(manager);

            Assert.IsNotNull(testingTarget, "should be not null");
            Assert.IsInstanceOf <OrientationHelper>(testingTarget, "should be an instance of testing target class!");

            try
            {
                var result = testingTarget.GetTotalSpaceChange();
                tlog.Debug(tag, "GetTotalSpaceChange : " + result);
            }
            catch (Exception e)
            {
                tlog.Debug(tag, e.Message.ToString());
                Assert.Fail("Caught Exception : Failed!");
            }

            manager.Dispose();
            tlog.Debug(tag, $"OrientationHelperGetTotalSpaceChange END (OK)");
        }