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); }
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(); }
public void TryParse_should_return_empty_tag_collection_on_empty_string() { TagCollection.TryParse("", out var actual).Should().BeTrue(); actual.Should().BeEquivalentTo(new TagCollection()); }