Creating Test Case References

A place to share your useful hints for getting the most from Proclaim, be it as a user or an administrator.

Example maths items are best placed in the "Example Proclaim Maths" topic.
Code Killer
Posts: 28
Joined: Thu Oct 29, 2015 10:04 am
Location: Kent
Has thanked: 25 times
Been thanked: 2 times

Creating Test Case References

Post by Code Killer »

Hi All, I'm not sure how useful this will be or the rest of you but I've put this together today to help me create test references when creating a new linked case from maths.

Effectively it allows you to replace the "TESTPCN001" in CREATE( "TESTPCN001" , 199) with a new unique reference from the v-test_Case_Ref variable.

Code: Select all

#== 
#===== Create Unique Test File Reference 
#== 

    #=== Create Prefix String 
    v-test_Case_Type = "TEST" 
    v-test_File_Type = "PCN" 
    #=== Loop While Case Ref Exists 
    WHILE v-test_Case_Status <> "does not exist" DO 
        #=== Set First Test Ref To End 001 
        IF v-test_File_Number = 0 THEN 
            v-test_File_Number = 001  
        ELSE 
            #=== Add Leading Zeros As Maths Removes them 
            v-test_File_Number = v-test_File_Number + 01 
            v-len = LENGTH( v-test_File_Number v-test_File_Number ) 
            IF v-len = 1 AND v-test_File_Number = 2 THEN 
                v-test_File_Type = v-test_File_Type + "00"  
            ELSEIF v-len = 2 AND v-test_File_Number = 10 THEN 
                v-test_File_Type = v-test_File_Type + "0" 
            END 
        END 
        #=== Combine Strings And Numbers To Create Test Case Ref 
        v-test_Case_Ref = v-test_Case_Type + v-test_File_Type + v-test_File_Number 
        #MESSAGE( NEWLINE , "Test Case Ref: " , v-test_Case_Ref ) 
        #=== If Case Ref Exists Loop Until It Doesn't 
        STATUS( v-test_Case_Ref ) 
        v-test_Case_Status = return-value 
    END 
    #== 
    #===== Final Test Case Ref 
    #== 
    MESSAGE( NEWLINE , v-test_Case_Ref ) 

#== 
#===== Create Unique Test File Reference 
#== 
I hope this helps someone :D

John