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

            using (ViewWrapperImpl impl = new ViewWrapperImpl(CustomViewBehaviour.ViewBehaviourDefault))
            {
                var testingTarget = new ViewWrapper("CustomView", impl);
                Assert.IsNotNull(testingTarget, "should be not null");
                Assert.IsInstanceOf <ViewWrapper>(testingTarget, "should be an instance of testing target class!");

                var pinchGesture = testingTarget.viewWrapperImpl.GetPinchGestureDetector();
                Assert.IsInstanceOf <PinchGestureDetector>(pinchGesture, "should be an instance of testing target class!");

                var panGesture = testingTarget.viewWrapperImpl.GetPanGestureDetector();
                Assert.IsInstanceOf <PanGestureDetector>(panGesture, "should be an instance of testing target class!");

                var tapGesture = testingTarget.viewWrapperImpl.GetTapGestureDetector();
                Assert.IsInstanceOf <TapGestureDetector>(tapGesture, "should be an instance of testing target class!");

                var pressGesture = testingTarget.viewWrapperImpl.GetLongPressGestureDetector();
                Assert.IsInstanceOf <LongPressGestureDetector>(pressGesture, "should be an instance of testing target class!");

                testingTarget.Dispose();
            }

            tlog.Debug(tag, $"ViewImplGetGestureDetector (OK)");
        }
Esempio n. 2
0
        public void ViewImplEnableGestureDetection()
        {
            tlog.Debug(tag, $"ViewImplEnableGestureDetection START");

            using (ViewWrapperImpl impl = new ViewWrapperImpl(CustomViewBehaviour.ViewBehaviourDefault))
            {
                var testingTarget = new ViewWrapper("CustomView", impl);
                Assert.IsNotNull(testingTarget, "should be not null");
                Assert.IsInstanceOf <ViewWrapper>(testingTarget, "should be an instance of testing target class!");

                try
                {
                    testingTarget.viewWrapperImpl.EnableGestureDetection(Gesture.GestureType.LongPress);
                    testingTarget.viewWrapperImpl.DisableGestureDetection(Gesture.GestureType.LongPress);
                }
                catch (Exception e)
                {
                    tlog.Debug(tag, e.Message.ToString());
                    Assert.Fail("Caught Exception : Failed!");
                }

                testingTarget.Dispose();
            }

            tlog.Debug(tag, $"ViewImplEnableGestureDetection (OK)");
        }
Esempio n. 3
0
        public void ViewImplSetBackground()
        {
            tlog.Debug(tag, $"ViewImplSetBackground START");

            using (ViewWrapperImpl impl = new ViewWrapperImpl(CustomViewBehaviour.ViewBehaviourDefault))
            {
                var testingTarget = new ViewWrapper("CustomView", impl);
                Assert.IsNotNull(testingTarget, "should be not null");
                Assert.IsInstanceOf <ViewWrapper>(testingTarget, "should be an instance of testing target class!");

                using (ColorVisual colorVisual = new ColorVisual())
                {
                    colorVisual.Color = Color.Cyan;

                    try
                    {
                        testingTarget.viewWrapperImpl.SetBackground(colorVisual.OutputVisualMap);
                    }
                    catch (Exception e)
                    {
                        tlog.Debug(tag, e.Message.ToString());
                        Assert.Fail("Caught Exception : Failed!");
                    }
                }

                testingTarget.viewWrapperImpl.ClearBackground();

                testingTarget.Dispose();
            }

            tlog.Debug(tag, $"ViewImplSetBackground END (OK)");
        }
Esempio n. 4
0
        public void ViewWrapperImplConstructor()
        {
            tlog.Debug(tag, $"ViewWrapperImplConstructor START");

            var testingTarget = new ViewWrapperImpl(CustomViewBehaviour.ViewBehaviourDefault);

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

            testingTarget.Dispose();
            // disposed
            testingTarget.Dispose();
            tlog.Debug(tag, $"ViewWrapperImplConstructor END (OK)");
        }
Esempio n. 5
0
        public void ViewImplGetCPtr()
        {
            tlog.Debug(tag, $"ViewImplGetCPtr START");

            using (ViewWrapperImpl impl = new ViewWrapperImpl(CustomViewBehaviour.ViewBehaviourDefault))
            {
                var testingTarget = new ViewWrapper("CustomView", impl);
                Assert.IsNotNull(testingTarget, "should be not null");
                Assert.IsInstanceOf <ViewWrapper>(testingTarget, "should be an instance of testing target class!");

                var result = ViewWrapperImpl.getCPtr(testingTarget.viewWrapperImpl);
                tlog.Debug(tag, "getCptr : " + result);

                testingTarget.Dispose();
            }

            tlog.Debug(tag, $"ViewImplGetCPtr END (OK)");
        }
Esempio n. 6
0
        public void ViewImplSetKeyInputFocus()
        {
            tlog.Debug(tag, $"ViewImplSetKeyInputFocus START");

            using (ViewWrapperImpl impl = new ViewWrapperImpl(CustomViewBehaviour.ViewBehaviourDefault))
            {
                var testingTarget = new ViewWrapper("CustomView", impl);
                Assert.IsNotNull(testingTarget, "should be not null");
                Assert.IsInstanceOf <ViewWrapper>(testingTarget, "should be an instance of testing target class!");

                testingTarget.viewWrapperImpl.SetKeyInputFocus();
                var result = testingTarget.viewWrapperImpl.HasKeyInputFocus();
                tlog.Debug(tag, "HasKeyInputFocus : " + result);
                testingTarget.viewWrapperImpl.ClearKeyInputFocus();

                testingTarget.Dispose();
            }

            tlog.Debug(tag, $"ViewImplSetKeyInputFocus (OK)");
        }
Esempio n. 7
0
        public void ViewImplSetBackgroundColor()
        {
            tlog.Debug(tag, $"ViewImplSetBackgroundColor START");

            using (ViewWrapperImpl impl = new ViewWrapperImpl(CustomViewBehaviour.ViewBehaviourDefault))
            {
                var testingTarget = new ViewWrapper("CustomView", impl);
                Assert.IsNotNull(testingTarget, "should be not null");
                Assert.IsInstanceOf <ViewWrapper>(testingTarget, "should be an instance of testing target class!");

                using (Vector4 color = new Vector4(0.3f, 0.5f, 0.9f, 1.0f))
                {
                    testingTarget.viewWrapperImpl.SetBackgroundColor(color);
                    //tlog.Debug(tag, "BackgroundColor : " + wrapper.viewWrapperImpl.GetBackgroundColor());
                }

                testingTarget.Dispose();
            }

            tlog.Debug(tag, $"ViewImplSetBackgroundColor END (OK)");
        }
Esempio n. 8
0
        public void ViewImplSignal()
        {
            tlog.Debug(tag, $"ViewImplSignal START");

            using (ViewWrapperImpl impl = new ViewWrapperImpl(CustomViewBehaviour.ViewBehaviourDefault))
            {
                var testingTarget = new ViewWrapper("CustomView", impl);
                Assert.IsNotNull(testingTarget, "should be not null");
                Assert.IsInstanceOf <ViewWrapper>(testingTarget, "should be an instance of testing target class!");

                var signal = testingTarget.viewWrapperImpl.KeyEventSignal();
                Assert.IsInstanceOf <ControlKeySignal>(signal, "Should return ControlKeySignal instance.");

                var focusGained = testingTarget.viewWrapperImpl.KeyInputFocusGainedSignal();
                Assert.IsInstanceOf <KeyInputFocusSignal>(focusGained, "Should return ControlKeySignal instance.");

                var focusLost = testingTarget.viewWrapperImpl.KeyInputFocusLostSignal();
                Assert.IsInstanceOf <KeyInputFocusSignal>(focusLost, "Should return ControlKeySignal instance.");

                testingTarget.Dispose();
            }

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