Delimiter //
/**	
 * Test of getting laoder info value
 * 
 * @tested GET_LOADER_INFO()
 */
Drop Procedure if exists TEST_GET_LOADER_INFO//
Create Procedure TEST_GET_LOADER_INFO ()
Begin
	-- initial dataset
	call LOADER_INFO_TABLES;

	insert into LOADER_INFO(LOADER_INFO_BATCH_NUM, LOADER_INFO_NAME, LOADER_INFO_VALUE) 
	values 
		(1, 'A', 'BCD'),
		(1, 'E', 'FG'),
		(2, 'A', 'HIJ'),
		(2, 'K', 'LMN')
	;

	-- Assertions
    CALL utAssert_eq('could get value with same batch and key'
        , 'HIJ'
        , GET_LOADER_INFO ('A', 2)
    );

    CALL utAssert_notEq('could not get value When batch exists but key'
        , 'HIJ'
        , GET_LOADER_INFO ('Aazazaz', 2)
    );


    CALL utAssert_notEq('could not get value When key exists but batch'
        , 'HIJ'
        , GET_LOADER_INFO ('E', 100)
    );


    CALL utAssert_eq('null was return when try get unexistant info'
        , Null
        , GET_LOADER_INFO ('NONON', 100)
    );

	-- clear data set
	call LOADER_INFO_TABLES;

end //