Akka.Tests.Actor.ReceiveActorTests.Test_that_actor_cannot_call_receive_out_of_construction_and_become C# (CSharp) Méthode

Test_that_actor_cannot_call_receive_out_of_construction_and_become() private méthode

        public void Test_that_actor_cannot_call_receive_out_of_construction_and_become()
        {
            //Given
            var system = ActorSystem.Create("test");
            var actor = system.ActorOf<CallReceiveWhenHandlingMessageActor>("receive-on-handling-message");

            //When
            actor.Tell("Something that will trigger the actor do call Receive", TestActor);

            //Then
            //We expect a exception was thrown when the actor called Receive, and that it was sent back to us
            ExpectMsg<InvalidOperationException>();
        }