I am trying to find the best way to parse message boxes from my logic so that I can properly resolve it. Now I was wondering if this was enough if I just made a separate helper class (C #), which I can later delete for my post. For example:
static class messageBoxHelper { public static void msgBoxAlg(string message, string title, MessageBoxButtons buttons, MessageBoxIcon icons, bool show) { if (show) { MessageBox.Show(message, title, buttons, icons); } }
Then every time I need to use the message box, I would just use messageboxHelper / msgBoxAlg (...) instead of messagebox.show (...). Using bool show, I could enable or disable it during testing.
I'm just wondering if this is right. By this I mean, is there an easier or better way to do it right? I canβt just turn off the mailboxes, they relay the "important" information to the user ("Do you want to close these windows?" YES / NO, etc.). Maybe I'm just not using proper software development, and should I separate my posts from my bussinesslogic anymore?
c # unit-testing messagebox
Enthusiastic programmer
source share