< Summary

Class:Utils
Assembly:Tests
File(s):/github/workspace/Assets/Tests/Utils.cs
Covered lines:0
Uncovered lines:5
Coverable lines:5
Total lines:11
Line coverage:0% (0 of 5)
Covered branches:0
Total branches:0
Covered methods:0
Total methods:1
Method coverage:0% (0 of 1)

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
CallPrivateMethod[T](...)0%6200%

File(s)

/github/workspace/Assets/Tests/Utils.cs

#LineLine coverage
 1using System.Reflection;
 2
 3public static class Utils
 4{
 5    public static object CallPrivateMethod<T>(T instance, string methodName, object[] parameters)
 06    {
 07        var methodInfo = typeof(T).GetMethod(methodName, BindingFlags.NonPublic | BindingFlags.Instance);
 08        if(methodInfo == null) throw new($"Method {methodName} does not exist in class {nameof(T)}");
 09        return methodInfo.Invoke(instance, parameters);
 010    }
 11}