public void ExecuteVoidValueMethod() { var executor = GetExecutorForMethod(nameof(TestObject.VoidValueMethod)); var result = executor.Execute( _targetObject, new object[] { 10 }); Assert2.False(executor.IsMethodAsync); Assert2.Null(result); }
public void ExecuteValueMethod() { var executor = GetExecutorForMethod(nameof(TestObject.ValueMethod)); var result = executor.Execute( _targetObject, new object[] { 10, 20 }); Assert2.False(executor.IsMethodAsync); Assert2.Equal(30, (int)result); }
public void ExecuteValueMethodWithReturnTypeThrowsException() { var executor = GetExecutorForMethod(nameof(TestObject.ValueMethodWithReturnTypeThrowsException)); var parameter = new TestObject(); Assert2.False(executor.IsMethodAsync); Assert2.Throws <NotImplementedException>( () => executor.Execute( _targetObject, new object[] { parameter })); }
public void ExecuteValueMethodWithReturnType() { var executor = GetExecutorForMethod(nameof(TestObject.ValueMethodWithReturnType)); var result = executor.Execute( _targetObject, new object[] { 10 }); var resultObject = Assert2.IsType <TestObject>(result); Assert2.False(executor.IsMethodAsync); Assert2.Equal("Hello", resultObject.value); }
public void ExecuteValueMethodUpdateValue() { var executor = GetExecutorForMethod(nameof(TestObject.ValueMethodUpdateValue)); var parameter = new TestObject(); var result = executor.Execute( _targetObject, new object[] { parameter }); var resultObject = Assert2.IsType <TestObject>(result); Assert2.False(executor.IsMethodAsync); Assert2.Equal("HelloWorld", resultObject.value); }