1 # This file is part of NIT ( http://www.nitlanguage.org ).
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
15 module test_commands_graph
is test
18 import doc
::commands
::commands_graph
20 class TestCommandsGraph
24 fun test_cmd_uml
is test
do
25 var cmd
= new CmdUML(test_view
, mentity_name
= "test_prog::Character")
26 var res
= cmd
.init_command
27 assert res
isa CmdSuccess
28 assert cmd
.uml
!= null
31 fun test_cmd_uml_bad_format
is test
do
32 var cmd
= new CmdUML(test_view
, mentity_name
= "test_prog::Character", format
= "foo")
33 var res
= cmd
.init_command
34 assert res
isa ErrorBadGraphFormat
35 assert cmd
.uml
== null
38 fun test_cmd_uml_not_found
is test
do
39 var cmd
= new CmdUML(test_view
, mentity_name
= "strength_bonus")
40 var res
= cmd
.init_command
41 assert res
isa WarningNoUML
42 assert cmd
.uml
== null
45 fun test_cmd_inh_graph
is test
do
46 var cmd
= new CmdInheritanceGraph(test_view
, mentity_name
= "test_prog::Character")
47 var res
= cmd
.init_command
48 assert res
isa CmdSuccess
49 assert cmd
.graph
!= null