本文整理汇总了C#中Stage.Find方法的典型用法代码示例。如果您正苦于以下问题:C# Stage.Find方法的具体用法?C# Stage.Find怎么用?C# Stage.Find使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Stage
的用法示例。
在下文中一共展示了Stage.Find方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Can_create_child_actor
public void Can_create_child_actor()
{
var stage = new Stage();
var tester = stage.Create<IContextTester>("tester").Proxy;
var x = tester.Can_create_child_actor().WaitForResult();
Debug.WriteLine("ref: {0}", x.Item2);
var a = stage.Find<IIdentity>(x.Item2);
var id = a.Proxy.GetIdentity().WaitForResult();
Assert.AreEqual(id, x.Item1);
}
示例2: Can_find_actor_by_ref
public void Can_find_actor_by_ref()
{
var stage = new Stage();
var a1 = stage.Create<IIdentity>();
var b1 = stage.Create<IIdentity>();
var a2 = stage.Find<IIdentity>(a1.Ref);
var b2 = stage.Find<IIdentity>(b1.Ref);
var a1Id = a1.Proxy.GetIdentity().WaitForResult();
var a2Id = a2.Proxy.GetIdentity().WaitForResult();
var b1Id = b1.Proxy.GetIdentity().WaitForResult();
var b2Id = b2.Proxy.GetIdentity().WaitForResult();
Assert.AreNotEqual(a1Id,b1Id,"actor ids were the same");
Assert.AreEqual(a1Id, a2Id, "a ids did not match");
Assert.AreEqual(b1Id, b2Id, "b ids did not match");
}