I'm not sure if this is expected behavior.
interface IDo
{
void Do();
}
sealed class DoNothing : IDo
{
void IDo.Do() { }
}
class TheDoNothing
{
[Test]
public void CanActLike()
{
var instance = new DoNothing();
var acting = instance.ActLike<IDo>();
acting.Do(); // throws RuntimeBinderException
}
}
I read about Dynamitey UsagePrivate but this produces the same result.
class TheDoNothing
{
[Test]
public void CanActLike()
{
var instance = new DoNothing();
var context = new InvokeContext(instance, typeof(IDo));
var acting = context.ActLike<IDo>();
acting.Do(); // throws RuntimeBinderException
}
}
Obviously this a toy example, but I'm running into real issues when trying to do something similar using DynamicActLike() with an interface type known only at runtime.
I'm not sure if this is expected behavior.
I read about Dynamitey UsagePrivate but this produces the same result.
Obviously this a toy example, but I'm running into real issues when trying to do something similar using DynamicActLike() with an interface type known only at runtime.