public void TestTwoArgumentMethodWithOnlyOneArgumentProvided()
 {
     TestBean testBean = new TestBean();
     NameResolvingMethodInvoker invoker = new NameResolvingMethodInvoker(testBean,
                                                                         "StringAndIntegerArgumentMethod");
     invoker.InvokeMethod("ABC");
 }
 public void TestStringArgumentWithVoidReturnAndSuccessfulConversion()
 {
     TestBean testBean = new TestBean();
     NameResolvingMethodInvoker invoker = new NameResolvingMethodInvoker(testBean, "StringArgumentWithVoidReturn");
     invoker.InvokeMethod(123);
     Assert.That(testBean.lastStringArgument, Is.EqualTo("123"));
 }
 public void TestIntegerArgumentWithVoidReturnAndFailedConversion()
 {
     TestBean testBean = new TestBean();
     NameResolvingMethodInvoker invoker = new NameResolvingMethodInvoker(testBean,
                                                                         "IntegerArgumentWithVoidReturn");
     invoker.InvokeMethod("ABC");
 }
 public void TestTwoArgumentsAndNoConversionRequired()
 {
     TestBean testBean = new TestBean();
     NameResolvingMethodInvoker invoker = new NameResolvingMethodInvoker(testBean,
                                                                         "StringAndIntegerArgumentMethod");
     object result = invoker.InvokeMethod("ABC", 456);
     Assert.That(result, Is.EqualTo("ABC:456"));
 }
 public void TestTwoArgumentsAndSuccessfulConversion()
 {
     TestBean testBean = new TestBean();
     NameResolvingMethodInvoker invoker = new NameResolvingMethodInvoker(testBean,
                                                                         "StringAndIntegerArgumentMethod");
     object result = invoker.InvokeMethod("ABC", "789");
     Assert.That(result, Is.EqualTo("ABC:789"));
 }
 public void AfterPropertiesSet()
 {
     if(method != null) {
         invoker = new DefaultMethodInvoker(obj, method);
     }
     else if(methodName != null) {
         NameResolvingMethodInvoker nrmi = new NameResolvingMethodInvoker(obj, methodName);
         nrmi.MethodValidator = new MessageReceivingMethodValidator();
         invoker = nrmi;
     }
     else {
         throw new ArgumentException("either 'method' or 'methodName' is required");
     }
 }