Esempio n. 1
0
 public void TestKeyValue()
 {
     Assert.Equal(new[] {
         new Tag {
             Key = "id", Value = "123AB"
         }
     }, TagsTextParser.Parse("id=123AB"));
 }
Esempio n. 2
0
 public void TestKeyNoValue()
 {
     Assert.Equal(new[] {
         new Tag {
             Key = "id", Value = null
         }
     }, TagsTextParser.Parse("id"));
 }
Esempio n. 3
0
 public void TestKeyEmptyValue()
 {
     Assert.Equal(new[] {
         new Tag {
             Key = "id", Value = ""
         }
     }, TagsTextParser.Parse("id="));
 }
Esempio n. 4
0
 public void TestMultipleKeyValuesOneEmptyValue()
 {
     Assert.Equal(new[] {
         new Tag {
             Key = "id", Value = ""
         },
         new Tag {
             Key = "netsplit", Value = "tur"
         }
     }, TagsTextParser.Parse("id=;netsplit=tur"));
 }
Esempio n. 5
0
        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;;")
                );
        }
Esempio n. 6
0
 public void TestNoTags()
 {
     Assert.Throws <ParseException>(() => TagsTextParser.Parse(""));
 }
Esempio n. 7
0
 public void TestEmptyKeyValue()
 {
     Assert.Throws <ParseException>(
         () => TagsTextParser.Parse("=123AB;")
         );
 }