public void AllMessages_ShouldBeCastedToDerviedType() { foreach (var message in messages) { dynamic dynamicMessage = message; Assert.IsTrue(MessagingTestHelper.IsMessagePayloadDerived(dynamicMessage)); } }
public void DeserializeMessage_ShouldReturnDerivedTypeMessage() { foreach (var message in messages) { var serialized = MessageSerializer.SerializeMessage(message); dynamic deserialized = MessageSerializer.DeserializeMessage(serialized); Assert.IsTrue(MessagingTestHelper.IsMessagePayloadDerived(deserialized)); } }
public void DeserializeMessage_ShouldReturnDerivedTypeMessageAfterAddingToList() { var deserializedMessages = new List <BaseMessage>(); foreach (var message in messages) { var serialized = MessageSerializer.SerializeMessage(message); deserializedMessages.Add(MessageSerializer.DeserializeMessage(serialized)); } foreach (var deserializedMessage in deserializedMessages) { dynamic dynamicMessage = deserializedMessage; Assert.IsTrue(MessagingTestHelper.IsMessagePayloadDerived(dynamicMessage)); } }