Linked Questions
115 questions linked to/from How do I write an Apex unit test?
0
votes
1
answer
27
views
write an primitive testclass [duplicate]
I am new to apex, and I dont know how to correctly write a Testclass for my trigger.
Trigger has to update field Time_Zone__c of object Task according to Time_Zone__c of object Contact, which is ...
0
votes
0
answers
25
views
Test class for the code below [duplicate]
// Hi Community, I need a help to write a test class for this code, can someone help me with?
public with sharing class PropRentTotalSum {
public static void RentTotal(List<Fee__c> ...
0
votes
0
answers
22
views
Test class for apex class which is selecting multiple record ids from list view [duplicate]
Can anyone guide me how to write test class for below apex class.
Actually my class works when I select multiple records from list view and on clicking custom button, I am using VF Page to show the ...
0
votes
0
answers
21
views
Hi am new for Salesforce Please help with write test class for My trigger handler Class [duplicate]
Trigger
trigger AuditRecCreationFromBilling on Billing__c (after insert , after update) {
if(trigger.isAfter && trigger.isInsert){
AuditRecCreationFromBillingHandler....
0
votes
0
answers
21
views
Writing a test class for an invocable method that combines the UTC dates of the beginning of the year and the current time [duplicate]
I built an apex class for an invocable method that runs from a flow to generate a link to authenticate a user to a community. The apex class updates a field on the contact record when the contact (a ...
0
votes
0
answers
19
views
test class for attachments for events in salesforce [duplicate]
Hi can anyone please help me with a test class for below two methods
global static void insertAttachment(string eventid, Map<String, Object> json_body) {
try {
Map&...
0
votes
0
answers
18
views
Assistance with Test Class [duplicate]
I could get a sample class to automatically deactivate inactive users in Salesforce and did some changes to it:
public class DeactivateInactiveUsers implements Schedulable {
public void ...
0
votes
0
answers
16
views
Test class for converted lead [duplicate]
Please let us know how to cover the line oppID.add(convopp.ConvertedOpportunityId); in below class.
public class sampleclass
{
public static void sampleMethod(List<Lead> convertLeads)
{...
0
votes
0
answers
15
views
How to write the Test class for the Apex Trigger [duplicate]
trigger populateContactEmail on Case (before insert , before update){
Set<Id> setConIds = new Set<Id>();
for(Case obj : trigger.new){
if(obj.Secondary_Contact__c != null)
...
0
votes
0
answers
15
views
Need test class for preventing email change on contact after user has entered the email earlier [duplicate]
Apex class:
public class Contacttriggerhandler {
public static void preventEmailChange(list<contact> conlist,Map<Id,Contact> myoldmap){
for(Contact newcon: ...
0
votes
0
answers
14
views
Help with <Select Option> Test Class [duplicate]
I am attempting to write several parts of code that work together to show Classic formatted list views (with pages to click through) in Lightning and am barely knowledgable in HTML, CSS and sort of ...
0
votes
0
answers
14
views
How to write test class for batch in salesforce [duplicate]
I have a Batch like this, how to write test class coverage 100% for it. Please help me, thanks
public class StoreWorkTimeBatch2 implements Database.Batchable{
public Database.QueryLocator start(...
1
vote
0
answers
14
views
Need help for create the test class [duplicate]
I'm a new developer and it's my first test class. I need your help to do it the class test for my helper class.
HELP ME PLEASE!!
@isTest
public class TestOrderWizardHelper {
static ...
0
votes
0
answers
13
views
Writing Apex Extension Test [duplicate]
I was graciously given the code below by sfdcfox, however after spending the night googling for test class walkthroughs I can't seem to figure it out.
Would anyone have any resources to share or be ...
0
votes
0
answers
11
views
Help test this REST method [duplicate]
Please help test this method
I don't undestend how testing this method
public static Weather getWeather(String city){
String KEY = 'My Key';
HttpRequest request = new HttpRequest();
...