Пример #1
0
        public void CreateChildUsingTestActor()
        {
            var motherActor = ActorOfAsTestActorRef <MotherActor>(
                MotherActor.Props(context => TestActor));

            motherActor.Tell("705243F7-2C1B-4CEE-9B5F-80AE88649180");
            ExpectMsg("705243F7-2C1B-4CEE-9B5F-80AE88649180");
        }
Пример #2
0
        public void CreateChildUsingProbe()
        {
            var childProbe  = CreateTestProbe();
            var motherActor = ActorOfAsTestActorRef <MotherActor>(
                MotherActor.Props(context => childProbe.Ref));

            motherActor.Tell("66A68CB8-AA85-4484-966F-63E64A0C183F");
            childProbe.ExpectMsg("66A68CB8-AA85-4484-966F-63E64A0C183F");
        }
Пример #3
0
        public void CreateChildUsingRealChildActor()
        {
            IActorRef childActor  = null;
            var       motherActor = ActorOfAsTestActorRef <MotherActor>(
                MotherActor.Props(context => childActor = context.ActorOf(ChildActor.Props(), "ChildActor")), "MotherActor");

            childActor.Path.ToString().Should().Be("akka://test/user/MotherActor/ChildActor");
            motherActor.Tell("6076F8AE-164D-4687-9CA7-1D90F33EC6AF");
            ExpectMsg("6076F8AE-164D-4687-9CA7-1D90F33EC6AF-Child");
        }