예제 #1
0
        public void CanSerializeActorRef()
        {
            var message = new SomeMessage
            {
                ActorRef = TestActor,
            };

            var serializer   = Sys.Serialization.FindSerializerFor(message);
            var serialized   = serializer.ToBinary(message);
            var deserialized = (SomeMessage)serializer.FromBinary(serialized, typeof(SomeMessage));

            Assert.Same(TestActor, deserialized.ActorRef);
        }
예제 #2
0
        public void CanSerializeActorRef()
        {
            var message = new SomeMessage
            {
                ActorRef = testActor,
            };

            var serializer = sys.Serialization.FindSerializerFor(message);
            var serialized = serializer.ToBinary(message);
            var deserialized = (SomeMessage)serializer.FromBinary(serialized, typeof(SomeMessage));

            Assert.Same(testActor, deserialized.ActorRef);
        }
예제 #3
0
        public void CanSerializeFutureActorRef()
        {
            sys.EventStream.Subscribe(testActor, typeof(object));
            var empty = sys.ActorOf<EmptyActor>();
            empty.Ask("hello");
            var f = (FutureActorRef)queue.Take();


            var message = new SomeMessage
            {
                ActorRef = f,
            };

            var serializer = sys.Serialization.FindSerializerFor(message);
            var serialized = serializer.ToBinary(message);
            var deserialized = (SomeMessage)serializer.FromBinary(serialized, typeof(SomeMessage));

            Assert.Same(f, deserialized.ActorRef);
        }
예제 #4
0
        public void CanSerializeFutureActorRef()
        {
            Sys.EventStream.Subscribe(TestActor, typeof(object));
            var empty = Sys.ActorOf<EmptyActor>();
            empty.Ask("hello");
            var f = ExpectMsg<FutureActorRef>();


            var message = new SomeMessage
            {
                ActorRef = f,
            };

            var serializer = Sys.Serialization.FindSerializerFor(message);
            var serialized = serializer.ToBinary(message);
            var deserialized = (SomeMessage)serializer.FromBinary(serialized, typeof(SomeMessage));

            Assert.Same(f, deserialized.ActorRef);
        }