Currently the Vlingo.Actors.ProxyGenerator class has some limitations. We will need to enhance it to overcome these.
It cannot create a proxy for an inner interface contained within a class. It would create a source that would fail compilation by the Vlingo.Common.DynaCompiler.Compile()
public class MyClass
{
public interface IMyInterface
{
void DoSomething();
}
}
public class MyActor : Actor, MyClass.IMyInterface
{
public void DoSomething() { }
}
For the code above, the following setup will fail
var world = World.StartWithDefault("test-world");
// it fails in the line below
var actor = world.ActorFor<MyClass.IMyInterface>(Definition.Has<MyActor>(Definition.NoParameters, "actor"));
Assert.NotNull(actor);
It fails similarly if the interface is not inner, but it references to any inner type.
public class MyOuterClass
{
public class MyInnerClass
{
}
}
public interface IMyInterface
{
void DoSomethingWith(MyOuterClass.MyInnerClass obj);
}
public class MyActor : Actor, IMyInterface
{
public void DoSomethingWith(MyOuterClass.MyInnerClass obj) { }
}
For the code above, the following setup will fail
var world = World.StartWithDefault("test-world");
// it fails in the line below
var actor = world.ActorFor<IMyInterface>(Definition.Has<MyActor>(Definition.NoParameters, "actor"));
Assert.NotNull(actor);
Currently the
Vlingo.Actors.ProxyGenerator
class has some limitations. We will need to enhance it to overcome these.It cannot create a proxy for an inner interface contained within a class. It would create a source that would fail compilation by the
Vlingo.Common.DynaCompiler.Compile()
For the code above, the following setup will fail
It fails similarly if the interface is not inner, but it references to any inner type.
For the code above, the following setup will fail