Re: [TFUI] Re: [TDD] Testing Dialogs

Phlip <[email protected]> Tue, 17 Oct 2006 10:42:04 -0700
Newsgroups gmane.comp.programming.test-first-user-interfaces
Message-ID <[email protected]>
Anderson, Kelly wrote:

> I would create a modeless window given a choice. But I don't have a
> choice.

That's just a specification. Just match it, and ensure the code
behaves like your customers need.

> Perhaps you are suggesting that I use a modeless window for testing,
> even if the window is modal in the real program?

Yes. Like I said, for windows, a modal window is nothing but a
modeless window with these enhancements:

 - parent window is disabled
 - DoModal calls an event loop for you

That breaks an important GUI guideline that an app should only have
one event loop. MS had to make their windows jump through hoops
(called TranslateMessage()) just to enable custom event loops.

If you TFUI, you should control your event loop, so you will be better
off with a modeless window and the parent window disabled. That will
behave exactly like a modal window.

> I'd be really interested in an example of the semaphore technique. I
> don't have a lot of experience with thread programming, none at all in
> .Net really.

To do that, all you must do is replace your sleep with a semaphore.
Google will help with that. But now your other thread must send it. So
you are back to using multiple threads to create a single-threaded
program.

A modeless dialog will lead to a better architecture, both test-side
and code-side.

-- 
  Phlip
  http://c2.com/cgi/wiki?ZeekLand  <-- NOT a blog!!


To unsubscribe, email:
TestFirstUserInterfaces-unsubscribe-hHKSG33TihhbjbujkaE4pw@public.gmane.org
 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/TestFirstUserInterfaces/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/TestFirstUserInterfaces/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:TestFirstUserInterfaces-digest-hHKSG33TihhbjbujkaE4pw@public.gmane.org 
    mailto:TestFirstUserInterfaces-fullfeatured-hHKSG33TihhbjbujkaE4pw@public.gmane.org

<*> To unsubscribe from this group, send an email to:
    TestFirstUserInterfaces-unsubscribe-hHKSG33TihhbjbujkaE4pw@public.gmane.org

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/