You need to sign in to do that
Don't have an account?
sandeepathadu
help with test case
this is the trigger i have wriiten trigger caseAssignWebCaseToAccountOwner on Case (before update) { for(case c :trigger.new){ ID profile = [select id from Profile where name = 'System Administrator'].id; user u = [Select id,name,IsActive from user where ProfileId =: profile limit 1 ]; if(c.Origin == 'Portal' && c.SSP_owner_Update__c==false && c.accountid!=null && u.isactive == True){ account a = [select id,name,OwnerId from account where id=:c.accountid]; c.ownerid=a.ownerID; c.SSP_owner_Update__c=true; } else if(c.Origin == 'Portal' && u.isactive == false ) c.ownerid='005Q0000000f95r'; } } the test case i have wriiten getting 87 percent not covering the else part plz help @istest private class UpdateTicketOwner_Test { static testMethod void MytestClass() { Account a1 = new Account(); a1.Name='SriRam'; a1.CurrencyIsoCode='INR'; a1.Primary_Contact_s_Email__c='SriRam@Y-Axis.com'; insert a1; Case c1 = new Case(); c1.Accountid=a1.id; c1.CurrencyIsoCode='INR'; c1.Status='New'; c1.Origin='Portal'; c1.Priority='Medium'; c1.SSP_owner_Update__c=false; insert c1; update c1; if((c1.Origin == 'Portal')&&(c1.SSP_owner_Update__c==false)&&(c1.accountid!=null)) { c1.ownerid=a1.ownerID; c1.SSP_owner_Update__c=true; } } } plz help
Here is your test class
let me know if any issues in it.
All Answers
Please do not post duplicate, once you have posted your problem you will get help soon from any one of us.
http://boards.developerforce.com/t5/General-Development/hi-help-with-test-case/m-p/314081#M58289
Thanks
Ankit Arora
Blog | Facebook | Blog Page
Here is your test class
let me know if any issues in it.