File tree Expand file tree Collapse file tree
tests/ModelContextProtocol.Tests/Protocol Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ public static void PromptMessage_SerializationRoundTrip_WithImageContent()
2929 var original = new PromptMessage
3030 {
3131 Role = Role . Assistant ,
32- Content = new ImageContentBlock { Data = "base64data" , MimeType = "image/png" }
32+ Content = new ImageContentBlock { Data = System . Text . Encoding . UTF8 . GetBytes ( "base64data" ) , MimeType = "image/png" }
3333 } ;
3434
3535 string json = JsonSerializer . Serialize ( original , McpJsonUtilities . DefaultOptions ) ;
@@ -38,7 +38,7 @@ public static void PromptMessage_SerializationRoundTrip_WithImageContent()
3838 Assert . NotNull ( deserialized ) ;
3939 Assert . Equal ( Role . Assistant , deserialized . Role ) ;
4040 var imageBlock = Assert . IsType < ImageContentBlock > ( deserialized . Content ) ;
41- Assert . Equal ( "base64data" , imageBlock . Data ) ;
41+ Assert . Equal ( "base64data" , System . Text . Encoding . UTF8 . GetString ( imageBlock . Data . ToArray ( ) ) ) ;
4242 Assert . Equal ( "image/png" , imageBlock . MimeType ) ;
4343 }
4444}
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ public static void ReadResourceResult_SerializationRoundTrip_PreservesAllPropert
2323 {
2424 Uri = "file:///image.png" ,
2525 MimeType = "image/png" ,
26- Blob = "base64data"
26+ Blob = System . Text . Encoding . UTF8 . GetBytes ( "base64data" )
2727 }
2828 ] ,
2929 Meta = new JsonObject { [ "key" ] = "value" }
@@ -43,7 +43,7 @@ public static void ReadResourceResult_SerializationRoundTrip_PreservesAllPropert
4343 var blobContent = Assert . IsType < BlobResourceContents > ( deserialized . Contents [ 1 ] ) ;
4444 Assert . Equal ( "file:///image.png" , blobContent . Uri ) ;
4545 Assert . Equal ( "image/png" , blobContent . MimeType ) ;
46- Assert . Equal ( "base64data" , blobContent . Blob ) ;
46+ Assert . Equal ( "base64data" , System . Text . Encoding . UTF8 . GetString ( blobContent . Blob . ToArray ( ) ) ) ;
4747
4848 Assert . NotNull ( deserialized . Meta ) ;
4949 Assert . Equal ( "value" , ( string ) deserialized . Meta [ "key" ] ! ) ;
You can’t perform that action at this time.
0 commit comments