rectangle.sa
Generated by gen_html_sa_files from ICSI. Contact gomes@icsi.berkeley.edu for details
class TEST_RECTANGLE
class TEST_RECTANGLE is
-- This class carries out tests on the class RECTANGLE which models
-- the notion of a planar rectangular area. Note that it is not portable
-- for simplicity in building a local library.
-- Version 1.0 Jan 00. Copyright K Hopper, U of Waikato
-- Development History
-- -------------------
-- Date Who By Detail
-- ---- ------ ------
-- 6 Jan 00 kh Original
include TEST ;
main is
class_name("RECTANGLE") ;
width : LENGTH := LENGTH::create(5.0,UNITS::Millimetres) ;
length : LENGTH := LENGTH::create(5.0,UNITS::Millimetres) ;
square_1 : RECTANGLE := RECTANGLE::create(width,length) ;
square_2 : RECTANGLE := RECTANGLE::create(5.0,5.0,UNITS::Millimetres) ;
test("creation",square_1.str,square_2.str) ;
test("equality",(square_1 = square_2).str,true.str) ;
point_x : POINT := POINT::create(length,width) ;
bounding : BOX := square_1.position(point_x) ;
second_bound : BOX := square_2.position(point_x) ;
test("position box",bounding.str,second_bound.str) ;
test("str (inches)",square_1.str(UNITS::Inches),
square_2.str(UNITS::Inches)) ;
finish
end ;
end ; -- TEST_RECTANGLE