Re: [TFUI] testing a grid control
Phlip <phlipcpp-/[email protected]>
| Newsgroups | gmane.comp.programming.test-first-user-interfaces |
|---|---|
| Message-ID | <[email protected]> |
apostolis_bekiaris wrote:
> i m using a 3rd part grid control bound to an
> arraylist. How could i
> test it? Could someone please provide a small
> sample?
>
> should i compare the data between the array and the
> grid?
> this is much work i suppose especially if the grid
> is a master-detail
> one
In what language? With what GUI Toolkit?
In pseudo-code, I would write a test like this:
suite_test_grid
{
MyHostWindow aWindow
setUp()
aWindow.Create()
aDatabase.beginTransaction()
test_integer()
aDatabase.push(7)
aWindow.refresh()
q = aWindow.getGrid().getCell(1,1).getValue()
assert 7 == q
test_string()
aDatabase.push("yo")
aWindow.refresh()
q = aWindow.getGrid().getCell(1,1).getValue()
assert "yo" == q
tearDown()
aWindow.Destroy()
aDatabase.rollBack()
}
More tests could then write sub-tables in the
database, and would query the cells they must fall
into.
For nearly all GUI Toolkits, the great thing is you
can do all that without displaying the window on the
screen. Windows buffer in memory, so tests can do
anything that production code would do during a
window's Create event, to prepare the window to
display, including querying its data out.
=====
Phlip
http://industrialxp.org/community/bin/view/Main/TestFirstUserInterfaces
__________________________________
Do you Yahoo!?
Check out the new Yahoo! Front Page.
www.yahoo.com
------------------------ Yahoo! Groups Sponsor --------------------~-->
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/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/