public void ToStruct() { var message = new TextSentimentPredictionInstance { Content = "some-content", MimeType = "some-mime-type" }; var structValue = ValueConverter.ToStruct(message); Assert.Equal(2, structValue.Fields.Count); Assert.Equal("some-content", structValue.Fields["content"].StringValue); Assert.Equal("some-mime-type", structValue.Fields["mimeType"].StringValue); }
public void ToMessage_Struct() { var structValue = new Struct { Fields = { { "content", ForString("some-content") }, { "mimeType", ForString("some-mime-type") }, } }; var actualMessage = ValueConverter.ToMessage <TextSentimentPredictionInstance>(structValue); var expectedMessage = new TextSentimentPredictionInstance { Content = "some-content", MimeType = "some-mime-type" }; Assert.Equal(expectedMessage, actualMessage); }