Delimiter //
/**
 * @test
 * Test For LOADER_CONTACTS_NORMALIZE_CONTACTS_CHECK_LAST_NAME_UPPERCASE
 */
DROP Procedure IF EXISTS TEST_LOADER_CONTACTS_LAST_NAME_UPPERCASE//

Create Procedure TEST_LOADER_CONTACTS_LAST_NAME_UPPERCASE()
Begin

    -- initial dataset
    CALL LOADER_TEST_MOCK_CONTACTS_CLEAN();

    CALL LOADER_TEST_MOCK_CONTACTS_PUSH(1, 'CONTACTS_INDIVIDUAL_LAST_NAME = ''abCd''', 1, NULL);
    CALL LOADER_TEST_MOCK_CONTACTS_PUSH(2, 'CONTACTS_INDIVIDUAL_LAST_NAME = ''COOL''', 2, NULL);

    -- Procedure
    CALL LOADER_CONTACTS_NORMALIZE_CONTACTS_CHECK_LAST_NAME_UPPERCASE(1);

    -- Assertions
    CALL utAssert_eq('Contacts with a not upper cased name are flagged'
        , 1
        , (SELECT LOADER_STATUS_ERRCOUNT FROM LOADER_STATUS WHERE ID_LOADER_STATUS = 1)
    );
    CALL utAssert_eq('Contacts with an upper cased name 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 ;