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