public void CopyActionToClipboard() { RichTextBox rtb = new RichTextBox(); rtb.Text = "All Watched Over By Machines Of Loving Grace"; rtb.Select(12, 5); var ac = new CopyTextAction(rtb); ac.Execute(); Assert.AreEqual("All Watched Over By Machines Of Loving Grace", rtb.Text, "Text is not disappear from textbox."); Assert.AreEqual("Over ", Clipboard.GetText(), "Clipboard has the text."); }
private void copyToolStripMenuItem_Click(object sender, EventArgs e) { CopyTextAction accc = new CopyTextAction(RTB); accc.Execute(); }