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

Test Class Issue
Hi,
I have a test class in which I am deleting all custom setting records first and then doing :
Has any one had ever encounter this?
I have a test class in which I am deleting all custom setting records first and then doing :
deleteAllCustomSettings(); //Custom method deleting all custom settings before starting a test. my_custom_settings__c settings = my_custom_settings__c.getInstance();When I am checking debig log for this "settings" object, I can see result like my_custom_setting__c:{SetupOwnerId = 005********} as a result but I am expecting "null"
Has any one had ever encounter this?
refer http://www.salesforce.com/us/developer/docs/apexcode/index_Left.htm#StartTopic=Content/apex_testing_data.htm
I understand that but my question was that I have to do it because there is a condition in my class where I am checking that if instance of Custom setting object is null. To cover that part I need to run this deleteAllCustomSettings() method to delete it. So that its instance become null and code will get covered.
Hope you got what I am trying to say here.
Thanks
Saransh