Ejemplo n.º 1
0
        public void CallMethodAction()
        {
            var c    = new TestCallMethodAction();
            var item = new ActionItem();

            c.TargetObject = item;
            c.MethodName   = "Method1";
            c.TestInvoke();

            Assert.AreEqual(true, item.IsMethod1Invoked);
        }
Ejemplo n.º 2
0
        public void CallMethodAction_With_Int_Parameter()
        {
            var c    = new TestCallMethodAction();
            var item = new GenericActionItem <int>();

            c.TargetObject = item;
            c.MethodName   = "Method1";
            c.Parameter    = 10;
            c.TestInvoke();

            Assert.AreEqual(true, item.IsMethod1Invoked);
            Assert.AreEqual(10, item.Method1Parameter);
        }
Ejemplo n.º 3
0
        public void CallMethodAction_With_String_Parameter()
        {
            var c    = new TestCallMethodAction();
            var item = new ActionItem();

            c.TargetObject = item;
            c.MethodName   = "Method2";
            c.Parameter    = "My parameter";
            c.TestInvoke();

            Assert.AreEqual(true, item.IsMethod2Invoked);
            Assert.AreEqual("My parameter", item.Method2Parameter);
        }
Ejemplo n.º 4
0
        public void CallMethodAction_With_DateTime_Parameter()
        {
            var c    = new TestCallMethodAction();
            var item = new GenericActionItem <DateTime>();

            var date = new DateTime(2019, 07, 18);

            c.TargetObject = item;
            c.MethodName   = "Method1";
            c.Parameter    = date;
            c.TestInvoke();

            Assert.AreEqual(true, item.IsMethod1Invoked);
            Assert.AreEqual(date, item.Method1Parameter);
        }
Ejemplo n.º 5
0
        public void Change_CallMethodAction_Properties()
        {
            var c    = new TestCallMethodAction();
            var item = new ActionItem();

            c.TargetObject = item;
            c.MethodName   = "Method1";
            c.TestInvoke();

            Assert.AreEqual(true, item.IsMethod1Invoked);

            c.MethodName = "Method2";
            c.Parameter  = "My parameter";
            c.TestInvoke();

            Assert.AreEqual(true, item.IsMethod2Invoked);
            Assert.AreEqual("My parameter", item.Method2Parameter);
        }