Re: [TFUI] [Article] User Interrogator and TDD

Cory Foy <[email protected]> Wed, 16 Nov 2005 20:55:45 -0500
Newsgroups gmane.comp.programming.test-first-user-interfaces
Message-ID <[email protected]>
Tim Haughton wrote:
> I've just uploaded an article and some source code to the TFUI files area:
>  http://groups.yahoo.com/group/TestFirstUserInterfaces/files/
>  The article is entitled 'User Interrogator and TDD' and is an example of
> how to test drive a user interface in C#. The article was written after an
> original thread on the TFUI list with Cory Foy and Anthony Williams.

Hi Tim,

I enjoyed the article. The concept of a user interrogator as an 
injectable middleman was quite intriguing. I guess that when you get 
right down to it the only way to handle UI controls in a form is by 
recursively using the MVP pattern to wrap all of the UI elements.

One comment I had was the ShowAndReturn method of IDialogLauncher. To 
me, a dialog, especially in C#, is a modal UI box. In that light, 
specifying whether or not user information will be collected through a 
Modal dialog or via some other method seems more like the responsibility 
of the view. But, either way, ShowAndReturn is a bit of a misnomer 
because we don't actually want to show anything, we want to collect it 
from a outside source (especially in our tests (unless we put in a 
reveal())).

So perhaps instead of an IDialogLauncher, we use an IFontCollector, that 
has a method Collect. Then, that gives us a seam where we could have the 
collection source be a mock, or a console, or a dialog. What do you think?

Also, both you and Anthony proposed solutions where the interrogator 
object was injected into the form. It seems to be that would be unweildy 
for larger forms, which is why I had chosen a Factory method. What has 
your experience been?

Thanks for taking the time to write that out - it definately makes me 
want to check NMock out some more!

Cory



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Get fast access to your favorite Yahoo! Groups. Make Yahoo! your home page
http://us.click.yahoo.com/dpRU5A/wUILAA/yQLSAA/nhFolB/TM
--------------------------------------------------------------------~-> 

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/

<*> 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/