function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
cptcpt 

TestMethod for Insertion

How to write the Test meyhod for ordinary Insertion please can amy one help me ...

 

    YodleeCredentials__c y1=new YodleeCredentials__c();
             y1.UserId__c=userName1;
              y1.Ypassword__c=Password1;
              y1.YuserId__c=YodleeUserId.format();
              y1.conversationSession__c=ConversationCredentials;
              insert y1;   

 

can u explain how to write for this please..

 

Pradeep_NavatarPradeep_Navatar

Test method is used for unit testing of your apex script. Suppose you have a class and in the methods you’ve written some apex script like SOQL queries and DML statements (as in your case). So in test method just create the instance of that class and invoke these methods. Apex script within these methods would get test coverage automatically. You don’t need to write special test scenario for that.

cptcpt

Hi,

   i am getting the test coverage but not 100% coverage, only some 40% for this class the DML statements might take some more testing inside the testmethod. Then how to cover the insert statement as i send already please reply ...