-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtct_suite.template
143 lines (129 loc) · 4.11 KB
/
tct_suite.template
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<!--(macro m_show)-->
<!--(if mshow)-->
${mshow}$#!
<!--(elif exists("mdefault"))-->
${mdefault}$
<!--(end)-->
<!--(end)-->
<!--(macro def_obj)-->${name_helpers.class_managed_name(param.type.class_)}$ ${prefix}$${param.name}$ = null;<!--(end)-->
<!--(macro def_param)-->
<!--(if param.type.type == param.type.type.CLASS)-->${def_obj(param=param, prefix=prefix)}$<!--(else)-->${suite.type_convert(param.type)}$ ${prefix}$${param.name}$ = default(${suite.type_convert(param.type)}$);<!--(end)-->
<!--(end)-->
<!--(macro def_params)-->
<!--(for p in parameters)-->
${def_param(param=p, prefix=default("prefix", "arg_"))}$
<!--(end)-->
<!--(end)-->
<!--(macro meth_target)-->
<!--(if func.is_class)-->${name_helpers.class_managed_name(cls)}$<!--(else)-->obj<!--(end)-->
<!--(end)-->
<!--(macro callget)-->
<!--(if not func.getter_return_type and len(list(func.getter_values)) == 1)-->
get_arg_${list(func.getter_values)[0].name}$ = ${meth_target(func=func, cls=cls)}$.Get${func.format_name}$(${', '.join(['get_arg_{}'.format(param.name) for param in func.getter_keys])}$);
<!--(else)-->
${meth_target(func=func, cls=cls)}$.Get${func.format_name}$(${', '.join(['get_arg_{}'.format(p.name) for p in func.getter_keys] + ['out get_arg_{}'.format(p.name) for p in func.getter_values])}$);
<!--(end)-->
<!--(end)-->
using System;
using System.Threading.Tasks;
using NUnit.Framework;
//using NUnit.Framework.TUnit;
namespace ${suite.name}$.Tests {
${m_show(mshow=suite.custom)}$#!
<!--(for cls in suite)-->
[TestFixture]
[Description("${suite.name}$.${cls.name.replace('.','')}$ Tests by automaTest")]
public class ${cls.name.replace('.','')}$Tests {
private static ${name_helpers.class_managed_name(cls)}$ obj;
${m_show(mshow=cls.custom)}$#!
<!--(include)-->
tct_setup.template
<!--(end)-->
<!--(include)-->
tct_teardown.template
<!--(end)-->
<!--(if cls.init)-->
CONSTN_constructor_null.template
<!--(end)-->
<!--(include)-->
CONSTR_constructor.template
<!--(end)-->
#! METHODS
<!--(for func in cls.methods)-->
<!--(include)-->
MR_method_call.template
<!--(end)-->
<!--(include)-->
MEX_method_exception.template
<!--(end)-->
<!--(for argenum in filter(func.is_enum, func.parameters))-->
<!--(include)-->
MAE_method_enum.template
<!--(end)-->
<!--(end)-->
<!--(if next(filter(func.is_number, func.parameters), False))-->
<!--(include)-->
MAR_method_in_out_range.template
<!--(end)-->
<!--(end)-->
<!--(end)--> #! METHODS END
#! PROPERTIES FUNCTION GET
<!--(for func in cls.properties)-->
<!--(if func.has_getter)-->
<!--(include)-->
PRO_prop_get_value.template
<!--(end)-->
<!--(for argenum in filter(func.is_enum, func.getter_keys))-->
<!--(include)-->
PRE_prop_get_enum.template
<!--(end)-->
<!--(end)-->
<!--(if next(filter(func.is_number, func.getter_keys), False))-->
<!--(include)-->
PMAX_prop_get_max_value.template
<!--(end)-->
<!--(include)-->
PMIN_prop_get_min_value.template
<!--(end)-->
<!--(if func.pam_init)-->
<!--(include)-->
PAM_prop_get_above_max_value.template
<!--(end)-->
<!--(end)-->
<!--(if func.pbm_init)-->
<!--(include)-->
PBM_prop_get_below_min_value.template
<!--(end)-->
<!--(end)-->
<!--(end)-->
<!--(end)-->
#! PROPERTIES FUNCTION SET
<!--(if func.has_setter)-->
<!--(if func.has_getter)-->
<!--(include)-->
PRW_prop_set_get.template
<!--(end)-->
<!--(end)-->
<!--(for argenum in filter(func.is_enum, func.setter_keys))-->
<!--(include)-->
MAE_prop_set_enum.template
<!--(end)-->
<!--(end)-->
<!--(if next(filter(func.is_number, func.setter_keys), False))-->
<!--(include)-->
PMAX_prop_set_max_val.template
<!--(end)-->
<!--(include)-->
PMIN_prop_set_min_val.template
<!--(end)-->
<!--(end)-->
<!--(end)-->
<!--(end)-->
<!--(for event in cls.events)-->
<!--(include)-->
EVENT_event.template
<!--(end)-->
<!--(end)-->
}
<!--(end)-->
}