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>(); }
public void InvokeOnGenericMethodThrowsException() { var methodReflection = new ClassToAnalyze(1, 1, 1).Reflection().GetMethod("GenericMethod"); methodReflection .Invoking(x => x.Invoke()) .Should() .Throw <InvalidOperationException>(); }