From b884881b444fda8253b0659a59e85efe3788645b Mon Sep 17 00:00:00 2001 From: halw Date: Wed, 4 Feb 2009 05:08:50 +0000 Subject: [PATCH] Author:halw Date:2009-02-04T05:08:50.000000Z git-svn-id: https://svn.eiffel.com/eiffel-org/trunk@178 abb3cda0-5349-4a8f-a601-0c33ac3a8c38 --- .../using-autotest/create-manual-test.wiki | 76 +++++++++++++++++-- .../testing-background-and-basics.wiki | 2 +- 2 files changed, 71 insertions(+), 7 deletions(-) diff --git a/documentation/current/eiffelstudio/eiffelstudio-guided-tour/using-autotest/create-manual-test.wiki b/documentation/current/eiffelstudio/eiffelstudio-guided-tour/using-autotest/create-manual-test.wiki index 272022ea..22f27c95 100644 --- a/documentation/current/eiffelstudio/eiffelstudio-guided-tour/using-autotest/create-manual-test.wiki +++ b/documentation/current/eiffelstudio/eiffelstudio-guided-tour/using-autotest/create-manual-test.wiki @@ -9,13 +9,7 @@ For developing our manual test, let's use a simple system that contains a class modeling bank accounts. Here are two classes that will make up our system. The first, APPLICATION will be the root class of our system. It looks like this: - -indexing - description : "bank_account_test application root class" - date : "$Date: 2008-09-19 11:33:35 -0700 (Fri, 19 Sep 2008) $" - revision : "$Revision: 74752 $" - class APPLICATION @@ -39,3 +33,73 @@ feature {NONE} -- Initialization end + +And here's the class BANK_ACCOUNT: + + +class + BANK_ACCOUNT +inherit + ANY + redefine + default_create + end +feature + default_create + do + balance := 300 + end + + balance: INTEGER + + deposit (an_amount: INTEGER) + do + ensure + balance_increased: balance > old balance + deposited: balance = old balance + an_amount + end + + withdraw (an_amount: INTEGER) + do + balance := balance - an_amount + ensure + balance_decreased: balance < old balance + withdrawn: balance = old balance + an_amount + end + +invariant + balance_not_negative: balance >= 0 +end + + +You shouldn't worry if you've noticed that the class BANK_ACCOUNT has some pretty obvious flaws. We'll deal with those later. + +If you want to work along with this tutorial, you should be able to copy the text of each these classes from this page and paste it into the EiffelStudio editor pane. Build a system using these two classes. + + +{{note|If you are using EiffelStudio version 6.3, there two things you will need to do to prepare your system for use with the Eiffel Testing Framework. Both of these are done from the [[EiffelStudio: Project settings window]].
1) Set your project to be a console application in the [[Advanced options]].
2) Set a value of False for the Recursive attribute of your project cluster in [[Group options]].}} + +==Getting to the Eiffel Testing Framework interface== + +If the Eiffel Testing Framework interface is not on a tab next to Clusters, Features, and Favorites, you can invoke it by following the menu path: + +View --> Tools --> Testing Tool + +Depending upon your version and platform, the Eiffel Testing Framework interface should look about like this: + + +[[Image:empty testing tool 01]] + + +==Creating a new test== + +To begin the process of creating a new test, click the Create New Tests button on the interface's tool bar. + +[[Image:create new tests]] + +If this is the first time you've used the testing tool for this project, it is likely that you will be presented with a dialog box asking if you want to add the testing library classes to your project and recompile. + +[[Image:add testing libraries dialog]] + + + diff --git a/documentation/current/eiffelstudio/eiffelstudio-guided-tour/using-autotest/testing-background-and-basics.wiki b/documentation/current/eiffelstudio/eiffelstudio-guided-tour/using-autotest/testing-background-and-basics.wiki index 7f2da833..4a62f08e 100644 --- a/documentation/current/eiffelstudio/eiffelstudio-guided-tour/using-autotest/testing-background-and-basics.wiki +++ b/documentation/current/eiffelstudio/eiffelstudio-guided-tour/using-autotest/testing-background-and-basics.wiki @@ -49,7 +49,7 @@ The Eiffel Testing Framework interface helps you to create and execute tests on {{definition|Test class|An effective class that inherits from the class EQA_TEST_SET. }} -{{definition|Test|Any procedure defined within the text of a test class that is exported to ANY and which takes no arguments. }} +{{definition|Test|Any procedure of a test class that satisfies all of the following conditions:
1) Is exported to ANY
2) Is immediate (i.e., introduced within the text of the test class)
3) Takes no arguments }} {{definition|Test set|The set of tests in a test class. }}