public void MethodAccessors_InvokeActionMethod_MethodWithoutParamsIsCalled() { var testObj = new MethodAccessorsTestClass(); testObj.InvokeActionMethod(nameof(MethodAccessorsTestClass.IncreaseCalls), null); Assert.Equal(1, testObj.method1Called); }
public void MethodAccessors_InvokeActionMethod_MethodWithParamsIsCalled() { var testObj = new MethodAccessorsTestClass(); testObj.InvokeActionMethod(nameof(MethodAccessorsTestClass.IncreaseCallsByIncrement), new object[] { 3 }); Assert.Equal(3, testObj.method1Called); }
public void MethodAccessors_InvokeActionMethod_MethodDoesNotExist(string invalidMethodName) { var testObj = new MethodAccessorsTestClass(); Assert.Throws <ArgumentException>(() => testObj.InvokeActionMethod(invalidMethodName, null)); }