Exemple #1
0
        public void Should_parse_incorrect_irc_message_correctly()
        {
            var message = ":irc.server.net 020 * :Please wait while we process your connection.";
            var details = MessageParser.GetDetails(message);

            Assert.That(details.Action, Is.EqualTo(""));
        }
Exemple #2
0
 public void Should_parse_hostmask_correctly()
 {
     inputMessages.ForEach(x =>
     {
         var assertMessage = string.Format("When: {0}", x);
         AssertStringIsIn(MessageParser.GetDetails(x).Hostmask, new string[] { "[email protected]", "" }, assertMessage);
     });
 }
Exemple #3
0
        public void Should_parse_private_message_correctly()
        {
            var message = ExampleMessages.UserPrivateMessageChannel;
            var details = MessageParser.GetDetails(message);

            Assert.That(details.Action, Is.EqualTo("PRIVMSG"));
            Assert.That(details.Parameters, Is.EqualTo("#auth user password"));
        }
Exemple #4
0
        public void Should_parse_message_with_smilies_correctly()
        {
            var message = ExampleMessages.UserPrivateMessageChannelWithSmilies;
            var details = MessageParser.GetDetails(message);

            Assert.That(details.Action, Is.EqualTo("PRIVMSG"));
            Assert.That(details.Target, Is.EqualTo("#mychannel"));
            Assert.That(details.Parameters, Is.EqualTo("hello :) there :'("));
        }
Exemple #5
0
        public void Should_parse_mode_change_message_correctly()
        {
            var message = ExampleMessages.UserChangeUsersModes;
            var details = MessageParser.GetDetails(message);

            Assert.That(details.Action, Is.EqualTo("MODE"));
            Assert.That(details.Parameters, Is.EqualTo("-o+o anotherUser stillAnotherUser"));
            Assert.That(details.Target, Is.EqualTo("#mychannel"));
        }