public void SerializeDeserializeComplexMessage() { var dtoMsg = new MessageDtoModelV1(ComplexMessage); var json = JsonSerializer.SerializeToString(dtoMsg); var dtoMsg2 = JsonSerializer.DeserializeFromString <MessageDtoModelV1>(json); Assert.AreEqual(dtoMsg.ToMessage(), dtoMsg2.ToMessage()); Assert.AreEqual(ComplexMessage, dtoMsg.ToMessage()); Assert.AreEqual(ComplexMessage, dtoMsg2.ToMessage()); }
public void ToMessageNreBug() { var dtoMsg = new MessageDtoModelV1(); var msg = dtoMsg.ToMessage(); Assert.True(msg.IsEmpty); }
public void SerializeDeserializeOnlyQuoteBug() { var msgWithOnlyQuote = new MessageBuilder(). AppendText("\""). ToMessage(); var dtoMsg = new MessageDtoModelV1(msgWithOnlyQuote); var json = JsonSerializer.SerializeToString(dtoMsg); var dtoMsg2 = JsonSerializer.DeserializeFromString <MessageDtoModelV1>(json); Assert.AreEqual(dtoMsg.ToMessage(), dtoMsg2.ToMessage()); }