public void Invoke()
        {
            ArgumentConvertingMethodInvoker vkr = new ArgumentConvertingMethodInvoker();

            vkr.TargetObject = new Voker();
            vkr.TargetMethod = "Hi";
            vkr.Arguments    = new object [] { "Rick, Mark, Griffin, Si, Choy, Aleks" };
            vkr.Prepare();
            string actual = vkr.Invoke() as string;

            Assert.IsNotNull(actual);
            Assert.AreEqual("Hi Rick, Mark, Griffin, Si, Choy, Aleks", actual);
        }
        public void InvokeWithRegisteredConversion()
        {
            ArgumentConvertingMethodInvoker vkr = new ArgumentConvertingMethodInvoker();

            // see if custom registration filters thru...
            vkr.RegisterCustomConverter(typeof(Voker), new VokerConverter());
            vkr.TargetType   = typeof(Voker);
            vkr.TargetMethod = "HiVoker";
            // arg should be converted to Voker
            vkr.Arguments = new object [] { "Lebowski" };
            vkr.Prepare();
            string actual = vkr.Invoke() as string;

            Assert.IsNotNull(actual);
            Assert.AreEqual("Hi Lebowski", actual);
        }
        public void InvokeAllNamedArgumentsWithConversion()
        {
            ArgumentConvertingMethodInvoker vkr = new ArgumentConvertingMethodInvoker();
            Voker instance = new Voker();

            vkr.TargetObject = instance;
            vkr.TargetMethod = "HiEverybody";
            // CSV string should be converted to string []
            vkr.AddNamedArgument("nameS", new object [] { "Rick, Mark, Griffin, Federico, Choy, Aleks" });
            vkr.Prepare();
            string actual = vkr.Invoke() as string;

            Assert.IsNotNull(actual);
            Assert.AreEqual("Hi ya'll", actual);
            Assert.IsNotNull(instance.developers);
        }