Loading ...
Sorry, an error occurred while loading the content.

Re: [XP] unit testing and GUI's

Expand Messages
  • Kevin Lawrence
    From: Phlip ... is ... Just so I m clear, Phlip, Are you suggesting encapsulating the dialog object in a class of your own that
    Message 1 of 3 , Nov 8, 2001
    • 0 Attachment
      From: "Phlip" <pplumlee@...>
      >Replace the call to the nag window with a call to a polymorphic object. At
      >run-time its derived type owns a nag window. At test time its derived type
      is
      >a Mock Object that Gets the result you want to get from the user.

      Just so I'm clear, Phlip,

      Are you suggesting encapsulating the dialog object in a class of your own
      that
      delegates calls to the dialog ?

      Something like this .... ?

      interface IDialog {
      void show( );
      String getSomething( );
      }

      class MyDialogWrapper implements IDialog {
      ActualDialog d;

      void show( ){
      d.show( );
      }
      String getSomething( ){
      return d.getSomething( );
      }
      }

      class MockDialog implements IDialog {
      .....
      }

      Or maybe that's not what you meant at all ?

      The reason I ask, is because I ran into this exact situation last week and
      decided
      it was too much trouble and used a different approach (that I wasn't really
      happy with). Maybe I'll go back and do it right.

      Thanks,

      Kevin
    Your message has been successfully submitted and would be delivered to recipients shortly.