本文整理汇总了C#中Meebey.SmartIrc4net.IrcClient.MessageParser方法的典型用法代码示例。如果您正苦于以下问题:C# IrcClient.MessageParser方法的具体用法?C# IrcClient.MessageParser怎么用?C# IrcClient.MessageParser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Meebey.SmartIrc4net.IrcClient
的用法示例。
在下文中一共展示了IrcClient.MessageParser方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MessageParser
public void MessageParser()
{
var client = new IrcClient();
var rawline = ":irc.example.com 001 meebey3 :Welcome to the EFnet Internet Relay Chat Network meebey3";
var msg = client.MessageParser(rawline);
Assert.AreSame(client, msg.Irc);
Assert.AreEqual(rawline, msg.RawMessage);
Assert.AreEqual("irc.example.com", msg.From);
Assert.AreEqual(null, msg.Nick);
Assert.AreEqual(null, msg.Ident);
Assert.AreEqual(null, msg.Host);
Assert.AreEqual(ReplyCode.Welcome, msg.ReplyCode);
Assert.AreEqual(ReceiveType.Login, msg.Type);
Assert.AreEqual("Welcome to the EFnet Internet Relay Chat Network meebey3", msg.Message);
Assert.AreEqual(null, msg.Channel);
Assert.IsNotNull(msg.Tags);
Assert.AreEqual(0, msg.Tags.Count);
rawline = ":irc.example.com 002 meebey3 :Your host is irc.example.com[127.0.0.1/6667], running version hybrid-7.2.2+oftc1.6.9";
msg = client.MessageParser(rawline);
Assert.AreSame(client, msg.Irc);
Assert.AreEqual(rawline, msg.RawMessage);
Assert.AreEqual("irc.example.com", msg.From);
Assert.AreEqual(null, msg.Nick);
Assert.AreEqual(null, msg.Ident);
Assert.AreEqual(null, msg.Host);
Assert.AreEqual(ReplyCode.YourHost, msg.ReplyCode);
Assert.AreEqual(ReceiveType.Login, msg.Type);
Assert.AreEqual("Your host is irc.example.com[127.0.0.1/6667], running version hybrid-7.2.2+oftc1.6.9", msg.Message);
Assert.AreEqual(null, msg.Channel);
Assert.IsNotNull(msg.Tags);
Assert.AreEqual(0, msg.Tags.Count);
rawline = ":irc.example.com 003 meebey3 :This server was created Aug 7 2011 at 12:43:41";
msg = client.MessageParser(rawline);
Assert.AreSame(client, msg.Irc);
Assert.AreEqual(rawline, msg.RawMessage);
Assert.AreEqual("irc.example.com", msg.From);
Assert.AreEqual(null, msg.Nick);
Assert.AreEqual(null, msg.Ident);
Assert.AreEqual(null, msg.Host);
Assert.AreEqual(ReplyCode.Created, msg.ReplyCode);
Assert.AreEqual(ReceiveType.Login, msg.Type);
Assert.AreEqual("This server was created Aug 7 2011 at 12:43:41", msg.Message);
Assert.AreEqual(null, msg.Channel);
Assert.IsNotNull(msg.Tags);
Assert.AreEqual(0, msg.Tags.Count);
rawline = ":irc.example.com 004 meebey3 irc.example.com hybrid-7.2.2+oftc1.6.9 CDGPRSabcdfgiklnorsuwxyz biklmnopstveI bkloveI";
msg = client.MessageParser(rawline);
Assert.AreSame(client, msg.Irc);
Assert.AreEqual(rawline, msg.RawMessage);
Assert.AreEqual("irc.example.com", msg.From);
Assert.AreEqual(null, msg.Nick);
Assert.AreEqual(null, msg.Ident);
Assert.AreEqual(null, msg.Host);
Assert.AreEqual(ReplyCode.MyInfo, msg.ReplyCode);
Assert.AreEqual(ReceiveType.Login, msg.Type);
Assert.AreEqual(null, msg.Message);
Assert.AreEqual(null, msg.Channel);
Assert.IsNotNull(msg.Tags);
Assert.AreEqual(0, msg.Tags.Count);
rawline = ":irc.example.com 005 meebey3 CALLERID CASEMAPPING=rfc1459 DEAF=D KICKLEN=160 MODES=4 NICKLEN=30 PREFIX=(ov)@+ [email protected]+ TOPICLEN=390 NETWORK=EFnet MAXLIST=beI:25 MAXTARGETS=4 CHANTYPES=#& :are supported by this server";
msg = client.MessageParser(rawline);
Assert.AreSame(client, msg.Irc);
Assert.AreEqual(rawline, msg.RawMessage);
Assert.AreEqual("irc.example.com", msg.From);
Assert.AreEqual(null, msg.Nick);
Assert.AreEqual(null, msg.Ident);
Assert.AreEqual(null, msg.Host);
Assert.AreEqual(ReplyCode.Bounce, msg.ReplyCode);
Assert.AreEqual(ReceiveType.Login, msg.Type);
Assert.AreEqual("are supported by this server", msg.Message);
Assert.AreEqual(null, msg.Channel);
Assert.IsNotNull(msg.Tags);
Assert.AreEqual(0, msg.Tags.Count);
rawline = ":irc.example.com 005 meebey3 CHANLIMIT=#&:25 CHANNELLEN=50 CHANMODES=eIb,k,l,imnpstMRS KNOCK ELIST=CMNTU SAFELIST AWAYLEN=160 EXCEPTS=e INVEX=I :are supported by this server";
msg = client.MessageParser(rawline);
Assert.AreSame(client, msg.Irc);
Assert.AreEqual(rawline, msg.RawMessage);
Assert.AreEqual("irc.example.com", msg.From);
Assert.AreEqual(null, msg.Nick);
Assert.AreEqual(null, msg.Ident);
Assert.AreEqual(null, msg.Host);
Assert.AreEqual(ReplyCode.Bounce, msg.ReplyCode);
Assert.AreEqual(ReceiveType.Login, msg.Type);
Assert.AreEqual("are supported by this server", msg.Message);
Assert.AreEqual(null, msg.Channel);
Assert.IsNotNull(msg.Tags);
Assert.AreEqual(0, msg.Tags.Count);
rawline = ":[email protected] JOIN :#debian.de";
msg = client.MessageParser(rawline);
Assert.AreSame(client, msg.Irc);
Assert.AreEqual(rawline, msg.RawMessage);
Assert.AreEqual("[email protected]", msg.From);
Assert.AreEqual("i_ron", msg.Nick);
//.........这里部分代码省略.........