java - Junit for MessageBoxProvider -
I have the code below
if (MessageBoxProvider.questionMessageBox (shell, title, message )) {Overwrite to return (file); }
How often I wanted to test (jeunit), how often the ordering method (file) method is called, I know that I can use the verification method to check My problem is If you can not go through that route or not, define an interface in which your message box Eg. In your class constructor, this Accept the type of object and store it. Switch to, you can control the control can duplicate the object and can be tested by the use of user. In your production code, use a solid implementation of this interface that will be used for your Such an approach has the advantage of making your application more portable. If you want to issue a command-line version or a web-based version, you can change the way your concrete implementation is implemented. MessageBoxProvider.questionMessageBox (shell
Public Interface Message Provider {Boolean Pause Question (title, message); // ...}
MessageBoxProvider
methods.
Comments
Post a Comment