Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating a script to run through all the application mod
Message
From
27/06/2006 19:45:07
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01132096
Message ID:
01132221
Views:
14
>I'm not sure what do I have to do. I've downloaded the code into FoxUnit folder on my C drive (it created its own FoxUnit folder underneath). I also created Tests folder under my main project folder.

Go ahead and move the items in the FoxUnit\FoxUnit sub-folder into the parent FoxUnit folder. Delete the sub-folder. The Zip file was set up to include the FoxUnit parent folder in the parth statements for all of the files, which is probably not the most common practice.

>Then I ran FXU program. It prompted me for a folder, so I pointed to the Tests folder. Then I pressed Create New Class button, specified c:\MMVisCollect\Libs\aLetters.vcx in this dialog, then pressed the first highlighted button on the next dialog. At this point it produced an error on the line
>
>THIS.MergeClassName(m.lcJustClassName)

"Create Class" is the button used to create a new test class. You correctly entered the test folder, but appear to have entered the name of an existing class where the name of the new "test class" PRG should be. (The test classes created by FoxUnit all reside in PRG files.) Instead, enter the name for the new test class PRG. If the class to be tested is named aLetters, you could name the new file "aLettersTests" (for example).

Go ahead and select the top button on the next dialog. This will create a FoxUnit test class based on the default template.

The code that references the class to test goes inside the new test class PRG. The default PRG includes a number of useful comments, with examples. A very simple test class could include the following:

1. A SetUp method to assign an object instantiated from the test class to a property.
2. A single "TestObjectCreated" method that uses the AssertNotNull() method to test that instantiation succeeded.
3. A TearDown method that releases the tested object and does any needed clean-up.

FoxUnit will seem simple to you once you use it a few times. The challenge after that is to write good, durable tests.

Chris
Christopher Bohling, Consultant
http://www.ChristopherBohling.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform