You could have a look at NUnitForms
] or change myMethod to take a flag to say whether or not to show the message e.g.
public int myMethod(bool ShowMessage = true)
int retVal = 1;
retVal = (MessageBox.Show("Sure?", "Title", MessageBoxButtons.YesNo) == DialogResult.Yes) ? 1 : 0;
Note however, changing the application to suit the test in this way isn't recommended.