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

            var testingTarget = new LottieButtonExtension();

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

            LottieFrameInfo            info     = new LottieFrameInfo(0, 100);
            Selector <LottieFrameInfo> selector = new Selector <LottieFrameInfo>(info);

            var style = new LottieButtonStyle()
            {
                BackgroundColor = Color.Cyan,
                LottieUrl       = lottie_url,
                PlayRange       = info
            };

            using (Button button = new Button(style))
            {
                using (ImageView view = new ImageView(image_path))
                {
                    var result = testingTarget.OnCreateIcon(button, view);
                    tlog.Debug(tag, "OnCreateIcon : " + result);
                }
            }

            tlog.Debug(tag, $"LottieButtonExtensionOnCreateIcon END (OK)");
        }
Ejemplo n.º 2
0
        public void LottieButtonExtensionConstructor()
        {
            tlog.Debug(tag, $"LottieButtonExtensionConstructor START");

            var testingTarget = new LottieButtonExtension();

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

            tlog.Debug(tag, $"LottieButtonExtensionConstructor END (OK)");
        }
Ejemplo n.º 3
0
        public void LottieButtonExtensionOnControlStateChanged()
        {
            tlog.Debug(tag, $"LottieButtonExtensionOnControlStateChanged START");

            var testingTarget = new LottieButtonExtension();

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

            LottieFrameInfo            info     = new LottieFrameInfo(0, 100);
            Selector <LottieFrameInfo> selector = new Selector <LottieFrameInfo>(info);

            var style = new LottieButtonStyle()
            {
                BackgroundColor = Color.Cyan,
                LottieUrl       = lottie_url,
                PlayRange       = info
            };

            using (Button button = new Button(style))
            {
                ControlStateChangedEventArgs args = new ControlStateChangedEventArgs(ControlState.Pressed, ControlState.Selected);

                try
                {
                    testingTarget.OnControlStateChanged(button, args);
                }
                catch (Exception e)
                {
                    tlog.Debug(tag, e.Message.ToString());
                    Assert.Fail("Caught Exception : Failed!");
                }
            }

            tlog.Debug(tag, $"LottieButtonExtensionOnControlStateChanged END (OK)");
        }