示例#1
0
        public void TryDeserialize_ValidString_CorrectlyDeserializedItems()
        {
            var value = "key1=value1, key2 = value2, invalidPair";

            var result = ActivityBaggageSerializer.Deserialize(value);

            result.Should().ContainEquivalentOf(new KeyValuePair <string, string>("key1", "value1"));
            result.Should().ContainEquivalentOf(new KeyValuePair <string, string>("key2", "value2"));
        }
示例#2
0
        public void Serialize_SomeItems_SerializedStringReturned()
        {
            var itemsToAdd = new List <KeyValuePair <string, string> >
            {
                new KeyValuePair <string, string>("key1", "value1"),
                new KeyValuePair <string, string>("key2", "value2"),
                new KeyValuePair <string, string>("key3", "value3")
            };

            var result = ActivityBaggageSerializer.Serialize(itemsToAdd);

            result.Should().Be("key1=value1,key2=value2,key3=value3");
        }
示例#3
0
        public void TryDeserialize_NullOrEmpty_EmptyCollectionReturned(string deserializeValue)
        {
            var result = ActivityBaggageSerializer.Deserialize(deserializeValue);

            result.Should().BeEmpty();
        }