Professional IronPython


Creating the Test Harness



Download 20,35 Mb.
Pdf ko'rish
bet402/453
Sana01.07.2022
Hajmi20,35 Mb.
#723045
1   ...   398   399   400   401   402   403   404   405   ...   453
Creating the Test Harness
An advantage to working with IronPython is that you need not create the test harness in one sitting. 
You can use an iterative technique to create the test harness. It’s possible to start with a small nugget 
of tests that you know you must perform, and then add to that nugget as other issues come to light. 
Eventually, you end up with a full-blown test suite.
Most .NET developers won’t initially understand the benefits of using an interpreter for testing, 
but the realization will grow with time that interpreters make things easy. If you get an idea, you 
don’t have to run a complete test or compile anything. All you need to do is open up the IronPython 
console, load the assembly you want to test, and then try out various tests until you come up with a 
perfect combination of items to use. At this point, you can click the system menu in the IronPython 
console, choose Edit
➤➤➪➤➤
Mark, highlight the text you want to copy from your experiments, and press 
Enter to copy it to the clipboard. Now you can paste the text you’ve created into your test harness 
and comment it. In fact, the IronPython console (and all consoles for that matter) provides a number 
of commands, as shown in Figure 18-1.
As an alternative, if you already have the beginnings of a test-harness check, but want to add to it, 
you can always paste the text directly into the IronPython console using the Paste command shown 
in Figure 18-1. The interpreter will automatically execute any statements that you paste into it, so 
you’ll be ready to start typing new code after you paste it.
Modularity is the name of the game when it comes to a test harness. Try to place the individual tests 
into separate files so that you can reuse the code later. Simply have a centralized file where you call 
each of the tests in turn. The tests will output the information you need to screen, so the developer 
using the test harness need not even know that there are multiple files involved.
548592c18.indd 391
2/24/10 12:49:44 PM
www.finebook.ir



Download 20,35 Mb.

Do'stlaringiz bilan baham:
1   ...   398   399   400   401   402   403   404   405   ...   453




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish