[Gambas-user] Integrate unittest component to Gambas

Christof Thalhofer chrisml at deganius.de
Sun Apr 22 00:26:01 CEST 2018


Am 21.04.2018 um 22:56 schrieb Benoît Minisini:

> Why having several tests in the same class? 

Because you can create a special fixture for all testmethods, for
example create a database and some tables and destroy them after testing
a couple of methods.

Have a look at

https://github.com/Deganius/gb.deg.unittest/

and there "Test fixture"

> I think if you do that, it
> means that you always want to run all of them, don't you?

No. Not while doing test-driven development:

I have a testcontainer that does a lot of db stuff. If I work on a
remote database, running it takes a while.

But if I just work on a separated part of my db library ... say the
update part ... I want to test just that, not also insert and delete and
ORM and so on ...

With the current code I can run $testcontainer.$testfunction (not
allcontainers.allfunctions).

That's fast. And yes, it's important.

> In ohter words, all tests located in a Test container should be run from 
> one Run() method.

Yes that's the case now, but:
Run(Optional Testcontainer as String, Optional Testmethod as String)


Alles Gute

Christof Thalhofer

-- 
Dies ist keine Signatur

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20180422/f309e155/attachment.sig>


More information about the User mailing list