Published on :
Unit Test INTERNAL_CREATION

Test of the _closeHTMLPage macro

This code is also available in: Français Deutsch Español
This script initializes a SASUnit test scenario. It configures a temporary ODS HTML destination, executes the _closeHTMLPage macro with default parameters while capturing log options (MPRINT), and validates execution by checking for specific messages in the log.
Data Analysis

Type : INTERNAL_CREATION


The script does not load external data. It creates a temporary HTML file in the WORK directory for testing purposes.

1 Code Block
MACRO CALL
Explanation :
SASUnit scenario initialization and opening of an ODS HTML destination pointing to a temporary file in the WORK library.
Copied!
1%initScenario (i_desc=Test of _closeHTMLPage.sas)
2ods html file="%sysfunc(pathname(WORK))\TEST.HMTL";
3 
2 Code Block
MACRO CALL
Explanation :
Test case configuration. MPRINT options are enabled to trace macro execution. The _closeHTMLPage macro is called, then original options are restored.
Copied!
1%initTestcase(i_object=_closeHTMLPage.sas, i_desc=Test with correct call);
2 
3%let l_mprint = %sysfunc(getoption(MPRINT));
4%let l_mprintnest = %sysfunc(getoption(MPRINTNEST));
5 
6options mprint mprintnest;
7 
8%_closeHTMLPage(Default);
9 
10options &l_mprint. &l_mprintnest.;
11 
12%endTestcall;
3 Code Block
MACRO CALL
Explanation :
Test validation via a log message assertion (verifies that the internal macro _OPENDUMMYHTMLPAGE was called), then closing of the test case and scenario.
Copied!
1%assertLogMsg(i_logMsg=MPRINT._CLOSEHTMLPAGE._OPENDUMMYHTMLPAGE.:);
2 
3%endTestcase;
4 
5%endScenario();
This material is provided "as is" by We Are Cas. There are no warranties, expressed or implied, as to merchantability or fitness for a particular purpose regarding the materials or code contained herein. We Are Cas is not responsible for errors in this material as it now exists or will exist, nor does We Are Cas provide technical support for it.
Copyright Info : Copyright 2010-2023 HMS Analytical Software GmbH, http://www.analytical-software.de