I am looking to skip a certain statement in my unit tests eg:
if (MessageBox.Show("Are you sure you want to remove " + contact.CompanyName + " from the contacts?", "Confirm Delete", MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.Yes) == MessageBoxResult.Yes)
is there an attribute i can place above the statement to avoid the unit test executing it?
you should try to avoid directly calling GUI components in the classes you are unit testing. One way around this would be to create an interface, say IMessageBoxDisplayService, which can be stubbed out for the test