示例#1
0
        public void MethodAccessors_InvokeActionMethod_MethodWithoutParamsIsCalled()
        {
            var testObj = new MethodAccessorsTestClass();

            testObj.InvokeActionMethod(nameof(MethodAccessorsTestClass.IncreaseCalls), null);
            Assert.Equal(1, testObj.method1Called);
        }
示例#2
0
        public void MethodAccessors_InvokeActionMethod_MethodWithParamsIsCalled()
        {
            var testObj = new MethodAccessorsTestClass();

            testObj.InvokeActionMethod(nameof(MethodAccessorsTestClass.IncreaseCallsByIncrement), new object[] { 3 });
            Assert.Equal(3, testObj.method1Called);
        }
示例#3
0
        public void MethodAccessors_InvokeActionMethod_MethodDoesNotExist(string invalidMethodName)
        {
            var testObj = new MethodAccessorsTestClass();

            Assert.Throws <ArgumentException>(() => testObj.InvokeActionMethod(invalidMethodName, null));
        }