Delimiter //
/**	
 * Test of "Checks if the $col$ is not null"
 * 
 * @tested LOADER_CONTACTS_CHECK_NULL()
 */
Drop Procedure if exists TEST_LOADER_CONTACTS_CHECK_NULL//
Create Procedure TEST_LOADER_CONTACTS_CHECK_NULL()
Begin

     -- initial dataset
    CALL LOADER_TEST_MOCK_CONTACTS_CLEAN();

    CALL LOADER_TEST_MOCK_CONTACTS_PUSH(1, 'CONTACTS_ADDRESSES_ZIP_CODE = ''''', 1, NULL);
    CALL LOADER_TEST_MOCK_CONTACTS_PUSH(2, 'CONTACTS_ADDRESSES_ZIP_CODE = ''FILLED''', 2, NULL);

    -- Procedure
    CALL LOADER_CONTACTS_CHECK_NULL('CONTACTS_ADDRESSES_ZIP_CODE', 1, 0, null);

    -- Assertions
    CALL utAssert_eq('Contacts with empty field are flagged with generic method'
        , 1
        , (SELECT LOADER_STATUS_ERRCOUNT FROM LOADER_STATUS WHERE ID_LOADER_STATUS = 1)
    );
    CALL utAssert_eq('Contacts with a not empty field are not flagged' 
        , 0
        , (SELECT LOADER_STATUS_ERRCOUNT FROM LOADER_STATUS WHERE ID_LOADER_STATUS = 2) 
    );
    
    -- clean
    CALL LOADER_TEST_MOCK_CONTACTS_CLEAN();

End //
Delimiter ;
