Professional IronPython



Download 20,35 Mb.
Pdf ko'rish
bet409/453
Sana01.07.2022
Hajmi20,35 Mb.
#723045
1   ...   405   406   407   408   409   410   411   412   ...   453
 

 
399
Creating the Application Test Script
As long as you’re willing to make the required visibility changes to your application, you can use 
IronPython to test it. Creating a test project for an application works precisely the same as creating 
a test project for a DLL. Here’s the short list of changes you must perform:
1.
Change the build output location for both the Debug and Release builds to the solution folder.
2.
Add 
IPY.EXE
as an existing project to your solution.
3.
Set the ipy project as the startup project so that the IDE executes it instead of the Windows 
Forms application.
4.
Configure the ipy project to start your script and to use the appropriate working directory.
5.
Add a new IronPython script to the solution folder.
This test script uses the three functions described in Listing 18-2 to provide output. It also adds the 
following two output functions:
# Verify the type. 
def CheckType(Object, Type):
if Object.GetType().__str__() == Type:
print ‘Test Passed’
else:
print ‘Test Failed’
# Show initial values. 
def ShowInit(Value1, Value2):
print ‘Value1: ‘, Value1
print ‘Value2: ‘, Value2
The 
CheckType()
function compares the type of an object you create against an expected type. If 
the type is incorrect, then it displays a failed message. You can use this function when creating a 
form or other object that could fail for any number of reasons.
The 
ShowInit()
function displays the initial values for a binary operation or perhaps just two values 
used for some other task. You could probably create a version of the function that accepts any number 
of arguments in the form of an array. The point is that you can create some specialized functions to 
display data for a particular test and then find that you can use it for other purposes later.
As previously mentioned, this test script also uses the three functions found in Listing 18-2. 
Listing 18-4 shows the actual test script for this application. It doesn’t provide a complete test but 
does provide enough information that you could easily complete it if you wanted.

Download 20,35 Mb.

Do'stlaringiz bilan baham:
1   ...   405   406   407   408   409   410   411   412   ...   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