Пример #1
0
        public void TryParse_should_right_tag_collection_on_given_string_with_valid_nodes()
        {
            const string initial  = "tag1═value1|tag═val=ue|tag=val═ue|tag2═|tag5═true";
            var          expected = new TagCollection
            {
                { "tag1", "value1" },
                { "tag", "val=ue" },
                { "tag=val", "ue" },
                { "tag2", "" },
                "tag5"
            };

            TagCollection.TryParse(initial, out var actual).Should().BeTrue();
            actual.Should().BeEquivalentTo(expected);
        }
Пример #2
0
 public void TryParse_should_return_null_tag_collection_and_false_on_bad_string(string badString)
 {
     TagCollection.TryParse(badString, out var actual).Should().BeFalse();
     actual.Should().BeNull();
 }
Пример #3
0
 public void TryParse_should_return_empty_tag_collection_on_empty_string()
 {
     TagCollection.TryParse("", out var actual).Should().BeTrue();
     actual.Should().BeEquivalentTo(new TagCollection());
 }