Example #1
0
 public void TestCapCommandMessage()
 {
     Assert.Equal(new Message
     {
         Tags       = null,
         Source     = null,
         Verb       = "CAP",
         Parameters = new string[] { "REQ", "sasl" }
     }, MessageTextParser.Parse("CAP REQ :sasl"));
 }
Example #2
0
 public void TestTagsFromPrivmsg()
 {
     Assert.Equal(
         new[] {
         new Tag {
             Key = "id", Value = "234AB"
         },
     }, MessageTextParser.Parse("@id=234AB :dan!d@localhost PRIVMSG #chan :Hey what's up!").Tags
         );
 }
Example #3
0
 public void TestUserMaskParsingFromPrivmsg()
 {
     Assert.Equal(
         new Fullhost
     {
         Nickname = "dan",
         Username = "******",
         Hostname = "localhost"
     }, FullhostTextParser.Parse(MessageTextParser.Parse("@id=234AB :dan!d@localhost PRIVMSG #chan :Hey what's up!").Source)
         );
 }
Example #4
0
 public void TestPrivmsgMessage()
 {
     Assert.Equal(new Message
     {
         Tags = new Tag[] { new Tag {
                                Key = "id", Value = "234AB"
                            } },
         Source     = "dan!d@localhost",
         Verb       = "PRIVMSG",
         Parameters = new string[] { "#chan", "Hey what's up!" }
     }, MessageTextParser.Parse("@id=234AB :dan!d@localhost PRIVMSG #chan :Hey what's up!"));
 }