Asi mi unika neco trivialniho, ale co?
Mam test ktery projde.
[Test]
public void TestInvokeMember0() {
AppDomain D = AppDomain.CurrentDomain;
Assembly A = (Assembly)D.GetType().InvokeMember(
"Load",
BindingFlags.Public | BindingFlags.Instance | BindingFlags.InvokeMethod,
null,
D,
new object[] { "mscorlib" });
Assert.IsTrue(D.Load("mscorlib") == A);
}
A pak mam test ktery neprojde:
[Test]
public void TestInvokeMember1() {
AppDomain D = AppDomain.CurrentDomain;
Assembly A = (Assembly)D.GetType().InvokeMember(
"InvokeMember",
BindingFlags.Public | BindingFlags.Instance | BindingFlags.InvokeMethod,
null,
D.GetType(),
new object[] {
"Load",
BindingFlags.Public | BindingFlags.Instance | BindingFlags.InvokeMethod,
null,
D,
new object[] { "mscorlib" }});
Assert.IsTrue(D.Load("mscorlib") == A);
}
Rozdil je v tom, ze druhy test zavola InvokeMember() ktery zavola InvokeMember() ktery zavola Load(). Ale neprojde to:
Errors and Failures:
1) Test Error : Bee.CLRInterop.Tests.TypeTests.TestInvokeMember1
System.MissingMethodException : Method 'System.AppDomain.InvokeMember' not found.
at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
at System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args)
at Bee.CLRInterop.Tests.TypeTests.TestInvokeMember1() in h:\Projects\Bee\sources3\bee-clr-interop-tests\Bee.CLRInterop.Tests\TypeTests.cs:line 142
Napada nekoho, co mam blbe?