Esempio n. 1
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);
        }
Esempio n. 2
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);
        }
Esempio n. 3
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);
        }
Esempio n. 4
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);
        }
Esempio n. 5
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);
        }