Esempio n. 1
0
        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");
        }
Esempio n. 2
0
        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());
        }
Esempio n. 3
0
        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
            });
        }