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

            var testingTarget = new Animatable();

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

            testingTarget.RegisterProperty("dummy", new PropertyValue(6));
            var dummy = testingTarget.AddPropertyNotification("dummy", PropertyCondition.GreaterThan(5));

            Assert.IsNotNull(dummy, "should be not null");
            Assert.IsInstanceOf <PropertyNotification>(dummy, "should be an instance of PropertyNotification class!");

            var dummy2 = testingTarget.AddPropertyNotification("dummy", PropertyCondition.LessThan(10));

            Assert.IsNotNull(dummy2, "should be not null");
            Assert.IsInstanceOf <PropertyNotification>(dummy2, "should be an instance of PropertyNotification class!");

            try
            {
                testingTarget.RemovePropertyNotifications();
            }
            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());
            }

            dummy.Dispose();
            testingTarget.Dispose();
            tlog.Debug(tag, $"AnimatableRemovePropertyNotifications END (OK)");
        }
Exemplo n.º 2
0
        public void PropertyConditionGetArgumentCount()
        {
            tlog.Debug(tag, $"PropertyConditionGetArgumentCount START");

            var testingTarget = PropertyCondition.LessThan(100);

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

            Assert.AreEqual(1, testingTarget.GetArgumentCount(), $"Should be 1");
            Assert.AreEqual(100, testingTarget.GetArgument(0), $"Should be 100");

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