Ejemplo n.º 1
0
        public void MessagePassingTest()
        {
            var encoder = new PXMessageEncoder(new Type[] { typeof(TestMessages.TestMessageType1) });
            var message = TestMessages.TestMessageType1Sample1();

            Assert.AreEqual(encoder.DecodeMessage(encoder.EncodeMessage(message)), message);
        }
Ejemplo n.º 2
0
        public void FailPassingUnregisteredMessageTest()
        {
            var encoder = new PXMessageEncoder(new Type[] {});
            var message = TestMessages.TestMessageType1Sample1();

            PXUnregisteredMessageReceived received = Assert.Throws <PXUnregisteredMessageReceived>(delegate {
                encoder.DecodeMessage(encoder.EncodeMessage(message));
            });

            Assert.AreEqual(received.Message, $"Unregistered message with hash 155806286 received");
        }