Last change
on this file since 17712 was
15554,
checked in by rhanghof, 7 years ago
|
#2817:
- Unittests
- Bugfixes on the line projection based extreme point creation method
|
File size:
1.1 KB
|
Line | |
---|
1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Linq;
|
---|
4 | using System.Reflection;
|
---|
5 | using System.Text;
|
---|
6 | using System.Threading.Tasks;
|
---|
7 |
|
---|
8 | namespace HeuristicLab.Problems.BinPacking._3D.Utils.Tests {
|
---|
9 | internal static class TestUtils {
|
---|
10 | public static object InvokeStaticMethod(Type type, string methodName, object[] parameters) {
|
---|
11 | var method = type.GetMethod(methodName, System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static);
|
---|
12 | return method.Invoke(null, parameters);
|
---|
13 | }
|
---|
14 |
|
---|
15 | /// <summary>
|
---|
16 | /// Invokes a private method of an given object by using reflection
|
---|
17 | /// </summary>
|
---|
18 | /// <param name="type"></param>
|
---|
19 | /// <param name="o"></param>
|
---|
20 | /// <param name="methodName"></param>
|
---|
21 | /// <param name="parameters"></param>
|
---|
22 | /// <returns></returns>
|
---|
23 | public static object InvokeMethod(Type type, object o, string methodName, object[] parameters) {
|
---|
24 | var method = type.GetMethod(methodName, BindingFlags.NonPublic | BindingFlags.Instance);
|
---|
25 | return method.Invoke(o, parameters);
|
---|
26 | }
|
---|
27 | }
|
---|
28 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.