Macros for SAS Application Developers
https://github.com/sasjs/core
Loading...
Searching...
No Matches
mv_getviyafileextparms.test.sas
Go to the documentation of this file.
1/**
2 @file
3 @brief Testing mv_getviyafileextparms macro
4
5 <h4> SAS Macros </h4>
6 @li mf_isblank.sas
7 @li mp_assert.sas
8 @li mp_assertscope.sas
9 @li mv_getviyafileextparms.sas
10
11**/
12
13options mprint;
14
15%let mvarIgnoreList =
16 MC0_JADP1LEN MC0_JADP2LEN MC0_JADP3LEN MC0_JADPNUM MC0_JADVLEN
17 SASJSPROCESSMODE SASJS_STPSRV_HEADER_LOC;
18
19%put TEST 1 - Test with common extension, requesting only typeDefName parameter;
20%mp_assertscope(SNAPSHOT)
21%mv_getviyafileextparms(ext=txt, typeDefNameVar=viyaTypeDefName)
22%mp_assertscope(COMPARE
23 ,ignorelist=&mvarIgnoreList viyaTypeDefName
24)
25
26%mp_assert(
27 iftrue=(not %mf_isBlank(&viyaTypeDefName)),
28 desc=Check the requested macro variable viyaTypeDefName is not blank.
29)
30
31%put TEST 2 - Test with common extension, requesting only properties parameter;
32%mp_assertscope(SNAPSHOT)
33%mv_getviyafileextparms(ext=html, propertiesVar=viyaProperties)
34%mp_assertscope(COMPARE
35 ,ignorelist=&mvarIgnoreList viyaProperties
36)
37
38%mp_assert(
39 iftrue=(not %mf_isBlank(%superq(viyaProperties))),
40 desc=Check the requested macro variable viyaProperties is not blank.
41)
42
43%put TEST 3 - Test with common extension, requesting only mediaType parameter;
44%mp_assertscope(SNAPSHOT)
45%mv_getviyafileextparms(ext=mp3, mediaTypeVar=viyaMediaType)
46%mp_assertscope(COMPARE
47 ,ignorelist=&mvarIgnoreList viyaMediaType
48)
49
50%mp_assert(
51 iftrue=(not %mf_isBlank(&viyaMediaType)),
52 desc=Check the requested macro variable viyaMediaType is not blank.
53)
54
55%put TEST 4 - Test with common extension, requesting all parameters;
56%mp_assertscope(SNAPSHOT)
57%mv_getviyafileextparms(
58 ext=css,
59 typeDefNameVar=cssViyaTypeDefName,
60 propertiesVar=cssViyaProperties,
61 mediaTypeVar=cssViyaMediaType
62 )
63%mp_assertscope(COMPARE
64 ,ignorelist=
65 &mvarIgnoreList cssViyaTypeDefName cssViyaProperties cssViyaMediaType
66)
67
68%mp_assert(
69 iftrue=(not ( %mf_isBlank(&cssViyaTypeDefName) or
70 %mf_isBlank(%superq(cssViyaProperties)) or
71 %mf_isBlank(&cssViyaMediaType) ) ),
72 desc=Check a full set of requested macro variables are not blank.
73)
74
75
76%put TEST 5 - Test with invalid extension - requested parameters will be blank;
77%mp_assertscope(SNAPSHOT)
78%mv_getviyafileextparms(
79 ext=xxxINVALIDxxx,
80 typeDefNameVar=invalidTypeDefName,
81 propertiesVar=invalidProperties,
82 mediaTypeVar=invalidMediaType
83 )
84%mp_assertscope(COMPARE
85 ,ignorelist=
86 &mvarIgnoreList invalidTypeDefName invalidProperties invalidMediaType
87)
88
89%mp_assert(
90 iftrue=(
91 %mf_isBlank(&invalidTypeDefName) and
92 %mf_isBlank(%superq(invalidProperties)) and
93 %mf_isBlank(&invalidMediaType)
94 ),
95 desc=Check the requested macro variables are all blank.
96)