[TFUI] Start simple
"Ryder, Phran (Manchester _SDC)" <[email protected]> Thu, 29 Dec 2005 13:39:10 -0000
| Newsgroups | gmane.comp.programming.test-first-user-interfaces |
|---|---|
| Message-ID | <C1E84CB2E873D61180130008C791F2940B6B3610@EXCRSLTSBNET007> |
Hi, I have a question concerning the basic design/structure of testable Form
type UIs.
Suppose I have a very simple form with a single button called start. After
clicking the button I want the button to be disabled.
The test (Forgive me it is VB.net):
<TestFixture>Public Class Test_UI
<Test()> Public Sub StartButtonDisable()
Dim ui As New Form1()
ui.btnStart_Click(ui.btnStart, New System.EventArgs())
Assert.IsFalse(ui.btnStart.Enabled)
End Sub
End Class
And the code
Friend Sub btnStart_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnStart.Click
btnStart.Enabled = False
End Sub
At least that is the approach I have always taken. But if I want my Form (or
dialog) to be humble the code disabling the button should be elsewhere - or
so I have heard.
So how would you do it?
Phran Ryder
Manchester_sdc (Project Delivery)
Network Phone: 617 5651
External Phone: 0161 932 5651
Address:
Centron House
Rowlandsway
Wythenshawe
Manchester
M22 5SQ
---------------------------------------------------------------------------------------------------------------
This e-mail is intended only for the above addressee. It may contain
privileged information. If you are not the addressee you must not copy,
distribute, disclose or use any of the information in it. If you have
received it in error please delete it and immediately notify the sender.
evolvebank.com is a division of Lloyds TSB Bank plc.
Lloyds TSB Bank plc, 25 Gresham Street, London, EC2V 7HN. Registered in
England, number 2065. Telephone No: 020 7626 1500
Lloyds TSB Scotland plc, Henry Duncan House, 120 George Street,
Edinburgh EH2 4LH. Registered in Scotland, number 95237. Telephone
No: 0131 225 4555
Lloyds TSB Bank plc and Lloyds TSB Scotland plc are authorised and
regulated by the Financial Services Authority and represent only the
Scottish Widows and Lloyds TSB Marketing Group for life assurance,
pensions and investment business.
Signatories to the Banking Codes.
---------------------------------------------------------------------------------------------------------------
[Non-text portions of this message have been removed]
------------------------ Yahoo! Groups Sponsor --------------------~-->
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/KIlPFB/vlQLAA/TtwFAA/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/