public void when_wire_to_method()
        {
            var command = new RedirectToCommand();
            var testClass = new TestClassWithMethod();
            command.WireToMethod(testClass, "Method1");
            command.Invoke("value1");

            Assert.IsTrue(testClass.CallMethod1);
        }
Esempio n. 2
0
        public void when_wire_to_method()
        {
            var command   = new RedirectToCommand();
            var testClass = new TestClassWithMethod();

            command.WireToMethod(testClass, "Method1");
            command.Invoke("value1");

            Assert.IsTrue(testClass.CallMethod1);
        }
        public void when_many_invoke()
        {
            var command = new RedirectToCommand();
            var testClass = new TestClassWithMethod();
            command.WireToMethod(testClass, "Method2");
            command.InvokeMany(new List<string> { "value1", "value2", "value3" });

            Assert.AreEqual(3, testClass.List.Count);
            Assert.AreEqual("value1", testClass.List[0]);
            Assert.AreEqual("value2", testClass.List[1]);
            Assert.AreEqual("value3", testClass.List[2]);
        }
Esempio n. 4
0
        public void when_many_invoke()
        {
            var command   = new RedirectToCommand();
            var testClass = new TestClassWithMethod();

            command.WireToMethod(testClass, "Method2");
            command.InvokeMany(new List <string> {
                "value1", "value2", "value3"
            });

            Assert.AreEqual(3, testClass.List.Count);
            Assert.AreEqual("value1", testClass.List[0]);
            Assert.AreEqual("value2", testClass.List[1]);
            Assert.AreEqual("value3", testClass.List[2]);
        }