public void TestKeyValue() { Assert.Equal(new[] { new Tag { Key = "id", Value = "123AB" } }, TagsTextParser.Parse("id=123AB")); }
public void TestKeyNoValue() { Assert.Equal(new[] { new Tag { Key = "id", Value = null } }, TagsTextParser.Parse("id")); }
public void TestKeyEmptyValue() { Assert.Equal(new[] { new Tag { Key = "id", Value = "" } }, TagsTextParser.Parse("id=")); }
public void TestMultipleKeyValuesOneEmptyValue() { Assert.Equal(new[] { new Tag { Key = "id", Value = "" }, new Tag { Key = "netsplit", Value = "tur" } }, TagsTextParser.Parse("id=;netsplit=tur")); }
public void TestInvalidTags() { Assert.Throws <ParseException>( () => TagsTextParser.Parse(";") ); Assert.Throws <ParseException>( () => TagsTextParser.Parse("=;") ); Assert.Throws <ParseException>( () => TagsTextParser.Parse("=a;") ); Assert.Throws <ParseException>( () => TagsTextParser.Parse("id=1;;") ); }
public void TestNoTags() { Assert.Throws <ParseException>(() => TagsTextParser.Parse("")); }
public void TestEmptyKeyValue() { Assert.Throws <ParseException>( () => TagsTextParser.Parse("=123AB;") ); }