public void GetMessagesToPlayerTest() { MessageDAO target = new MessageDAO(); PlayerDAO player = new PlayerDAO(); Message message = CreateMessage(); target.InsertMessage(message); List <Message> inserted = target.GetMessagesToPlayer(playerTo.PlayerId); Assert.IsTrue(inserted.Count == 1); target.RemoveMessage(inserted[0].MessageId); }
public void RemoveMessageTest() { MessageDAO target = new MessageDAO(); PlayerDAO player = new PlayerDAO(); Message message = CreateMessage(); target.InsertMessage(message); List <Message> inserted = target.GetMessagesFrom(playerFrom.PlayerName); target.RemoveMessage(inserted[0].MessageId); Assert.IsNull(target.GetMessage(inserted[0].MessageId)); }
protected void btnBorrar_Click(object sender, EventArgs e) { MessageDAO.RemoveMessage(int.Parse(boxID.Text)); Response.Redirect("~/MessageList"); Context.ApplicationInstance.CompleteRequest(); }