Re: [TFUI] Testing WinForms
"Dan Bunea" <[email protected]> Thu, 05 Jan 2006 23:01:20 +0200
| Newsgroups | gmane.comp.programming.test-first-user-interfaces |
|---|---|
| Organization | http://danbunea.blogspot.com |
| Message-ID | <op.s2xbcig8fzqw46@dan> |
Hi, In my opinion testing if the text reaches the controller, after being entered into a textbox, is not very helpful, and it doesn't seem like a very useful test to me. Now testing from the customer's perspective, you should test only from the user interface, and have nothing to do with the controller. A test should follow the steps of preparing, acting and verifying but all from one perspective, and if that's the user perspective then , maybe entering a username and a password in a login panel is the preparation and acting is clicking the login button, and depending on the data introduced verifying is testing whether you've reached the right screen or that you have a message box saying that your credentials are wrong. I think that this can be very well done using NUnitForms, although I saw that usually using NUnitForms means writing a lot of code (I even wrote something about it: http://danbunea.blogspot.com/2005/08/simplifiing-nunitforms-functional.html). And if you don't want to be testing exclusivly from a customer perspective, I think Model View Presenter is a very good choice for TDD (http://danbunea.blogspot.com/2005/11/model-view-presenter-is-testing_27.html) Thanks, Dan On Thu, 05 Jan 2006 20:48:23 +0200, Stefan Lieser <[email protected]> wrote: > From: "Tim Haughton" <[email protected]> > >> What exactly is it you're trying to test? What aspect of the behaviour? >> It >> may be that you can achieve the desired testing by other methods. > > Some examples: > - Verify that text entered in a TextBox is propagated to underlying > controller. > - Verify that controls in a form are enabled/disabled depending on the > input > to other controls. > - Verify that input to a custom TextBox control is of specified format. > - Verify that a DataGridView contains the correct data and that entering > text into cells results in the correct updates to the business domain. > > I did most of these things by hand in the last years. But the more you > learn > about automated testing and the more you see your code quality being > better > and better because of TDD, the more you want to automate the GUI tests. > > So I will try the SendKeys class... > > > Sincerely, > Stefan Lieser > > > > To unsubscribe, email: > TestFirstUserInterfaces-unsubscribe-hHKSG33TihhbjbujkaE4pw@public.gmane.org > > > > YAHOO! GROUPS LINKS > > Visit your group "TestFirstUserInterfaces" on the web. > > To unsubscribe from this group, send an email to: > TestFirstUserInterfaces-unsubscribe-hHKSG33TihhbjbujkaE4pw@public.gmane.org > > Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. > > -- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/ 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/