One option is to use an interface for a mailbox such as
public interface IMessageBoxProvider { MessageBoxResult Show(string messageBoxText, string caption, MessageBoxButton button, MessageBoxImage icon, MessageBoxResult defaultResult); }
and a wrapper class that implements this interface and uses a regular or custom mailbox. In viewmodel you can use this as
private IMessageBoxProvider MessageBox { get; set; }
where MessageBox is a wrapper class. So, now you have separated the actual message box and, thus, you can conduct a single test, and what not.
Andreas Krebs
source share