|
From: Jonathan S. O. <jon...@yo...> - 2003-08-06 17:15:02
|
The little test case below seems to run fine.
The only problem I have seen is the printout for a violation case that =
fails
to fail!. With that fixed we should be ready to roll.
Good job.
Jonathan
=3D=3D=3D=3D=3D=3D=3D
class
TEST
inherit
UNIT_TEST
redefine setup, teardown end
creation
make
feature
=09
make is
do
make_test
add_boolean_case (agent test1)
add_boolean_case (agent test2)
add_violation_case (agent test3)
add_boolean_case (agent test4)
add_boolean_case (agent test5)
to_html ("tests.htm")
end
=09
feature -- cases
test1: BOOLEAN is
local
a: ARRAY[INTEGER]
do
comment("test1")
a :=3D <<1, 2, 3, 4, 5 >>
Result :=3D a.count =3D 5 and a.item(5) =3D 5
end
=09
test2: BOOLEAN is
local
a: ARRAY[INTEGER]
do
comment("test2")
a :=3D <<1, 2, 3, 4, 5 >>
Result :=3D a.count =3D 5 and a.item(3) =3D 3
end
=09
test3 is
local
a: ARRAY[INTEGER]
b: BOOLEAN
do
comment("test3")
a :=3D <<1, 2, 3, 4, 5 >>
b :=3D a.count =3D 5 and a.item(6) =3D 3
end
=09
test4: BOOLEAN is
do
comment("test4")
Result :=3D c.count =3D 5 and c.item(3) =3D 3
c.force(6,6)
end
=09
test5: BOOLEAN is
do
comment("test5")
Result :=3D c.count =3D 5 and c.item(3) =3D 3 and d =3D 1
-- d =3D 6 without teardown
end
feature -- fixture
c: ARRAY[INTEGER]
d: INTEGER
=09
setup is
do
c :=3D <<1, 2, 3, 4, 5 >>
d :=3D d + 1
end
=09
teardown is
do
d :=3D 0
end
=09
=09
end -- class TEST
|