示例#1
0
        public void Do_serialize_user_messages()
        {
            var message = new SomeUserMessage
            {
                A = "abc",
                B = 123,
                C = Guid.Empty
            };
            TestActor.Tell(message);

            var result = ExpectMsg<SomeUserMessage>();

            Assert.True(Sys.Settings.SerializeAllMessages);
            Assert.Equal(message, result);
            Assert.NotSame(message, result);
        }
示例#2
0
       public void DoesNotSerializesUserMessagesWhenSerializeAllMessagesIsOff()
       {
            var message = new SomeUserMessage
            {
                A = "abc",
                B = 123,
                C = Guid.Empty
            };
            testActor.Tell(message);

            var result = queue.Take();

            Assert.False(sys.Settings.SerializeAllMessages);
            Assert.Equal(message, result);
            Assert.Same(message, result);
        }
示例#3
0
        public void Do_serialize_user_messages()
        {
            var message = new SomeUserMessage
            {
                A = "abc",
                B = 123,
                C = Guid.Empty
            };

            TestActor.Tell(message);

            var result = ExpectMsg <SomeUserMessage>();

            Assert.True(Sys.Settings.SerializeAllMessages);
            Assert.Equal(message, result);
            Assert.NotSame(message, result);
        }
示例#4
0
        public void DoesNotSerializesUserMessagesWhenSerializeAllMessagesIsOff()
        {
            var message = new SomeUserMessage
            {
                A = "abc",
                B = 123,
                C = Guid.Empty
            };

            testActor.Tell(message);

            var result = queue.Take();

            Assert.False(sys.Settings.SerializeAllMessages);
            Assert.Equal(message, result);
            Assert.Same(message, result);
        }
示例#5
0
       public void SerializesUserMessagesWhenSerializeAllMessagesIsOn()
       {
           var config = ConfigurationFactory.ParseString(@"akka.actor.serialize-messages = on");
           var sys = ActorSystem.Create("test",config);
           testActor = sys.ActorOf(Props.Create(() => new TestActor(queue,messages)));      

           var message = new SomeUserMessage
           {
               A = "abc",
               B = 123,
               C = Guid.Empty
           };
           testActor.Tell(message);

           var result = queue.Take();

           Assert.True(sys.Settings.SerializeAllMessages);
           Assert.Equal(message, result);
           Assert.NotSame(message, result);
       }
示例#6
0
        public void SerializesUserMessagesWhenSerializeAllMessagesIsOn()
        {
            var config = ConfigurationFactory.ParseString(@"akka.actor.serialize-messages = on");
            var sys    = ActorSystem.Create("test", config);

            testActor = sys.ActorOf(Props.Create(() => new TestActor(queue, messages)));

            var message = new SomeUserMessage
            {
                A = "abc",
                B = 123,
                C = Guid.Empty
            };

            testActor.Tell(message);

            var result = queue.Take();

            Assert.True(sys.Settings.SerializeAllMessages);
            Assert.Equal(message, result);
            Assert.NotSame(message, result);
        }