Beispiel #1
0
        public void InvokeMethodWithNonNullParametersViaReflection_IsResult()
        {
            var instance = new TestReflectionClass1();
            var result   = instance.InvokeMethodWithNonNullParametersViaReflection("PublicMethodWithIntParameter", 99);

            Assert.AreEqual(99, result);
        }
Beispiel #2
0
        public void InvokeMethodWithNonNullParametersViaReflection_PassesParameters()
        {
            var instance = new TestReflectionClass1();

            instance.InvokeMethodWithNonNullParametersViaReflection("PublicMethodWithIntParameter", 88);
            Assert.AreEqual(88, instance.PublicMethodWithIntParameterData);
        }
Beispiel #3
0
        public void InvokeMethodWithNonNullParametersViaReflection_PropagatesNullReferenceExceptionNullParameter()
        {
            var instance = new TestReflectionClass1();

            ExceptionAssert.Propagates <NullReferenceException>(() =>
                                                                instance.InvokeMethodWithNonNullParametersViaReflection("PublicMethodWithIntParameter", new object[] { null }));
        }
Beispiel #4
0
        public void InvokeMethodWithNonNullParametersViaReflection_CallsMethod()
        {
            var instance = new TestReflectionClass1();

            instance.InvokeMethodWithNonNullParametersViaReflection("PublicParameterlessMethod");
            Assert.IsTrue(instance.PublicParameterlessMethodCalled);
        }