doc/commands: introduce graph commands
[nit.git] / src / doc / commands / tests / test_commands_graph.nit
1 # This file is part of NIT ( http://www.nitlanguage.org ).
2 #
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
6 #
7 # http://www.apache.org/licenses/LICENSE-2.0
8 #
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.
14
15 module test_commands_graph is test
16
17 import test_commands
18 import doc::commands::commands_graph
19
20 class TestCommandsGraph
21 super TestCommands
22 test
23
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
29 end
30
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
36 end
37
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
43 end
44
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
50 end
51 end