public void NoticeParses() { var message = ":Banane9 NOTICE #banane9 :Notice to channel!"; Assert.IsTrue(Notice.IsCorrectFormat(message)); var notice = new Notice(message); Assert.AreEqual<string>("Banane9", notice.User); Assert.AreEqual<string>("#banane9", notice.Recipient); Assert.AreEqual<string>("Notice to channel!", notice.Message); }
/// <summary> /// Dispatches the right events for the line. /// </summary> /// <param name="line">The line.</param> private void dispatchEventsFor(string line) { if (Messages.Message.IsCorrectFormat(line)) { //Tryed to order them by how often they appear. if (Messages.Server.PrivateMessage.IsCorrectFormat(line)) { var privateMessage = new Messages.Server.PrivateMessage(line); onPrivateMessage(privateMessage); onMessage(privateMessage); } else if (Messages.Server.NumericalMessage.IsCorrectFormat(line)) { var numericalMessage = new Messages.Server.NumericalMessage(line); onNumericalMessage(numericalMessage); onMessage(numericalMessage); } else if (Messages.Server.Notice.IsCorrectFormat(line)) { var notice = new Messages.Server.Notice(line); onNotice(notice); onMessage(notice); } else if (Messages.Server.NickMessage.IsCorrectFormat(line)) { var nickMessage = new Messages.Server.NickMessage(line); onNickMessage(nickMessage); onMessage(nickMessage); } else if (Messages.Server.JoinMessage.IsCorrectFormat(line)) { var joinMessage = new Messages.Server.JoinMessage(line); onJoinMessage(joinMessage); onMessage(joinMessage); } else if (Messages.Server.PartMessage.IsCorrectFormat(line)) { var partMessage = new Messages.Server.PartMessage(line); onPartMessage(partMessage); onMessage(partMessage); } else if (Messages.Server.QuitMessage.IsCorrectFormat(line)) { var quitMessage = new Messages.Server.QuitMessage(line); onQuitMessage(quitMessage); onMessage(quitMessage); } } }
/// <summary> /// Fires the Notice event. /// </summary> /// <param name="notice">The notice.</param> protected void onNotice(Notice notice) { if (Notice != null) Notice(this, notice); }
private void client_Notice(Client sender, Notice notice) { }