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

Can't get test coverage of this method!
Hi
i'm pretty new to dev & need a test script for tbelow, I have covered everything else but this!
public id appId {get; set;}
public Cart_item__c doRemoveApp() {
Cart_item__c doomedAccts = [
select id, name
from Cart_item__c
where id = :AppID];
try {
delete doomedAccts;
}
catch (DmlException e) {
// Process exception here
}
return Null;
}
thanks
Are you using it in a VF extension or a custom controller.Please paste the whole code so that we can help.
Hi, appid is pulled from a VF page
global without sharing class CartController {
public id appId {get; set;}
public Cart_item__c doRemoveApp() {
Cart_item__c doomedAccts = [
select id, name
from Cart_item__c
where id = :AppID];
try {
delete doomedAccts;
}
catch (DmlException e) {
// Process exception here
}
return Null;
}
}
thanks