public void MessageToString() { string message = ":[email protected] PRIVMSG ###cards :!card 4 2"; var parsed = new IRCMessage(message); var tostring = parsed.ToString(); Assert.AreEqual(message, tostring); }
public void IRCMessageToString() { string ircMsg = ":foo!bar@baz PRIVMSG #foo :Hello World"; var testTime = DateTime.Now; var message = new IRCMessage(ircMsg); var testString = String.Format("TimeStamp: {0}, IRC Message: ':foo!bar@baz PRIVMSG #foo :Hello World'", testTime); Assert.AreEqual(testString, message.ToString()); }
protected virtual void OnMessageReceived(IRCMessage msg) { Debug.WriteLine(msg.ToString()); if (FireEvent(PreMessageReceived, new MessageReceivedEventArgs(msg, _writer, TcpClient))) { if (FireEvent(MessageReceived, new MessageReceivedEventArgs(msg, _writer, TcpClient))) { FireEvent(PostMessageReceived, new MessageReceivedEventArgs(msg, _writer, TcpClient)); } } }
public void Send(IRCMessage message) { var raw = message.ToString(); this.Impl.Send(raw); }