예제 #1
0
        public void InvokeGenericOnNonGenericMethod()
        {
            var methodReflection = new ClassToAnalyze(1, 1, 1).Reflection().GetMethod("PrivateMethod");

            methodReflection
            .Invoking(x => x.InvokeGeneric(new Type[] { typeof(object) }))
            .Should()
            .Throw <InvalidOperationException>();
        }
예제 #2
0
        public void InvokeOnGenericMethodThrowsException()
        {
            var methodReflection = new ClassToAnalyze(1, 1, 1).Reflection().GetMethod("GenericMethod");

            methodReflection
            .Invoking(x => x.Invoke())
            .Should()
            .Throw <InvalidOperationException>();
        }