You need to sign in to do that
Don't have an account?

Test Class for bellow method..
HI FNds can you help me out.........
public string[] getclientLastName(){
String temp;
if((acc[0].Alias_Client_First_Name__c != Null)&&(acc[0].Alias_Client_Last_Name__c != Null)){
temp = acc[0].Alias_Client_Last_Name__c;
}
else{
temp = acc[0].LastName__c;
}
system.debug('----------'+temp);
clientLastName = new string[30];
if(temp == Null){
for(integer i=0 ; i< 30; i++){
clientLastName [i] = ' ';
}
return clientLastName;
}
integer totallenngth = 30;
integer realLength = temp.length();
if( realLength > 30){
realLength = 30;
}
integer remaingLength = 30 - realLength;
temp = temp.toUpperCase();
for(integer i=0;i<realLength ;i++){
clientLastName[i] = temp.substring(i,i+1);
system.debug('----'+i);
}
for(integer i=realLength;i< totallenngth ;i++){
clientLastName[i] = ' ';
}
return clientLastName;
}
Thanks for in advanced
public string[] getclientLastName(){
String temp;
if((acc[0].Alias_Client_First_Name__c != Null)&&(acc[0].Alias_Client_Last_Name__c != Null)){
temp = acc[0].Alias_Client_Last_Name__c;
}
else{
temp = acc[0].LastName__c;
}
system.debug('----------'+temp);
clientLastName = new string[30];
if(temp == Null){
for(integer i=0 ; i< 30; i++){
clientLastName [i] = ' ';
}
return clientLastName;
}
integer totallenngth = 30;
integer realLength = temp.length();
if( realLength > 30){
realLength = 30;
}
integer remaingLength = 30 - realLength;
temp = temp.toUpperCase();
for(integer i=0;i<realLength ;i++){
clientLastName[i] = temp.substring(i,i+1);
system.debug('----'+i);
}
for(integer i=realLength;i< totallenngth ;i++){
clientLastName[i] = ' ';
}
return clientLastName;
}
Thanks for in advanced
You need to first create an account with Client Name(first name and last name) and try to make the record pass the IF statements so you can test the conditional lines.