-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathPRW_prop_set_get.template
51 lines (47 loc) · 1.96 KB
/
PRW_prop_set_get.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
[Test]
[Category("P1")]
[Description("Calling Property Set ${func.name}$.")]
[Property("SPEC", "${suite.name}$.${cls.name}$.${func.name}$ A")]
[Property("SPEC_URL", "-")]
${m_show(mshow=func.set_criteria_custom,mdefault=' [Property("CRITERIA", "PRW")]')}$#!
[Property("AUTHOR", "AutomaTest Boot, automated@tst")]
public void ${func.name}$_PROPERTY_SET()
{
${def_params(parameters=func.setter_args)}$
${m_show(mshow=func.arg_set_init)}$#!
${m_show(mshow=func.set_init)}$#!
/* SETTING PROPERTY */
try
{
${meth_target(func=func, cls=cls)}$.Set${func.format_name}$(${', '.join([suite.print_arg(p) for p in list(func.setter_keys) + list(func.setter_values)])}$);
}
catch (Exception ex)
{
Assert.Fail("Should not throw exception. " + ex.ToString());
}
/* GETTING PROPERTY */
${def_params(parameters=func.getter_args, prefix="get_arg_")}$
${m_show(mshow=func.arg_get_init)}$#!
${m_show(mshow=func.get_init)}$#!
/* CALLING PROPERTY */
try
{
${callget()}$
}
catch (Exception ex)
{
Assert.Fail("Should not throw exception. " + ex.ToString());
}
<!--(for p in func.getter_values)-->
Assert.NotNull(get_arg_${p.name}$, "${p.name}$ should be readable");
Assert.IsInstanceOf<${suite.type_convert(p.type)}$>(get_arg_${p.name}$);
<!--(end)-->
/* Check set values */
<!--(for name in suite.intersect([x.name for x in func.getter_values], [y.name for y in func.setter_args]))-->
Assert.AreEqual(arg_${name}$, get_arg_${name}$, "Value of ${name}$ from getter is diferent from value set.");
<!--(end)-->
${m_show(mshow=func.arg_get_shutdown)}$#!
${m_show(mshow=func.get_shutdown)}$#!
${m_show(mshow=func.arg_set_shutdown)}$#!
${m_show(mshow=func.set_shutdown)}$#!
}