mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-21 09:27:59 +02:00
Added Variant support to reflected method invocation
This commit is contained in:
parent
5bdaeadc25
commit
2eb7ce3e1a
7 changed files with 387 additions and 7 deletions
|
@ -141,6 +141,10 @@ namespace Tests
|
|||
Test.Assert(result.Get<float>() == 123);
|
||||
result.Dispose();
|
||||
|
||||
result = methodInfo.Invoke(.(), .Create(100), .Create((int32)20), .Create(3.0f)).Get();
|
||||
Test.Assert(result.Get<float>() == 123);
|
||||
result.Dispose();
|
||||
|
||||
let attrC = methodInfo.GetCustomAttribute<AttrCAttribute>().Get();
|
||||
Test.Assert(attrC.mA == 71);
|
||||
Test.Assert(attrC.mB == 72);
|
||||
|
@ -149,6 +153,10 @@ namespace Tests
|
|||
var result = methodInfo.Invoke(ca, 100, (int32)20, 3.0f).Get();
|
||||
Test.Assert(result.Get<float>() == 123);
|
||||
result.Dispose();
|
||||
|
||||
result = methodInfo.Invoke(.Create(ca), .Create(100), .Create((int32)20), .Create(3.0f)).Get();
|
||||
Test.Assert(result.Get<float>() == 123);
|
||||
result.Dispose();
|
||||
case 2:
|
||||
Test.Assert(methodInfo.Name == "GetA");
|
||||
var result = methodInfo.Invoke(ca, 123).Get();
|
||||
|
@ -157,6 +165,9 @@ namespace Tests
|
|||
result = methodInfo.Invoke(ca2, 123).Get();
|
||||
Test.Assert(result.Get<int>() == 2123);
|
||||
result.Dispose();
|
||||
result = methodInfo.Invoke(.Create(ca2), .Create(123)).Get();
|
||||
Test.Assert(result.Get<int>() == 2123);
|
||||
result.Dispose();
|
||||
case 3:
|
||||
Test.Assert(methodInfo.Name == "__BfCtor");
|
||||
Test.Assert(methodInfo.IsConstructor);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue