Beispiel #1
0
        public void DeserializeMessage_ShouldThrowIfSetToThrowWithoutAgentId()
        {
            foreach (var message in messages)
            {
                var serialized = MessagingTestHelper.SerializeWithoutProperties(message, "agentID");

                Assert.Throws <JsonSerializationException>(() => MessageSerializer.DeserializeMessage(serialized, true));
            }

            Assert.Pass();
        }
Beispiel #2
0
        public void MessageSerializer_ShouldSetAgentIdToZeroIfNotProvided()
        {
            foreach (var message in messages)
            {
                var serialized   = MessagingTestHelper.SerializeWithoutProperties(message, "agentID");
                var deserialized = MessageSerializer.DeserializeMessage(serialized);

                Assert.AreEqual(0, deserialized.AgentId);
            }

            Assert.Pass();
        }