public void Input_cell_metadata_is_not_parsed_when_not_present() { var rawMetadata = new { dotnet_interactive_but_not_the_right_shape = new InputCellMetadata("fsharp") }; var rawMetadataJson = JsonSerializer.Serialize(rawMetadata); var metadata = MetadataExtensions.DeserializeMetadataFromJsonString(rawMetadataJson); metadata.Should() .NotContainKey("dotnet_interactive"); }
public void Input_cell_metadata_can_be_parsed_with_no_fields() { var rawMetadata = new { dotnet_interactive = new InputCellMetadata() }; var rawMetadataJson = JsonSerializer.Serialize(rawMetadata); var metadata = MetadataExtensions.DeserializeMetadataFromJsonString(rawMetadataJson); metadata.Should() .ContainKey("dotnet_interactive") .WhichValue .Should() .BeEquivalentToRespectingRuntimeTypes(new InputCellMetadata()); }
public void Input_cell_metadata_can_be_parsed_with_no_fields() { var rawMetadata = new { dotnet_interactive = new InputCellMetadata() }; var rawMetadataJson = JsonConvert.SerializeObject(rawMetadata); var metadata = MetadataExtensions.DeserializeMetadataFromJsonString(rawMetadataJson); metadata.Should() .ContainKey("dotnet_interactive") .WhichValue .Should() .BeEquivalentTo(new InputCellMetadata() { Language = null }); }