• Thedude
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 1
    Replies

How would I test this code:

 

public class StaffWithSchedule{
public Date StartDate {get;set;}
public Date EndDate {get;set;}
public Staff__c Staff {get;set;}
public Appointment__c helper{
get{

Appointment__c retAppt = new Appointment__c();
if(Staff != null)
retAppt.Sales_Rep_1__c = Staff.id;
return retAppt;
}
}
public List<Appointment__c> Appointments {get;set;}
public List<Event> Events {get;set;}
public List<Project_Activity__c> ProjectActivities{get;set;}
public StaffWithSchedule(Staff__c inStaff, List<Appointment__c> inAppointments, List<Event> inEvents, List<Project_Activity__c> inProjActs, Date inStartDate, Date inEndDate){
if(inAppointments == null)
inAppointments = new List<Appointment__c>();
if(inEvents == null)
inEvents = new List<Event>();
Staff = inStaff;
Appointments = inAppointments;
ProjectActivities = inProjActs;
Events = inEvents;
StartDate = inStartDate;
EndDate = inEndDate;
}

 

Thanks in advance

I need to create a test case for this code:

 

global class LeadConvertResult
{
global ID ProspectId {get;set;}
global boolean Success {get;set;}
global Integer Strength {get;set;}

global LeadConvertResult()
{
Success = false;
Strength = 0;
}

 

How would I go about doing this?

     

I am new to the apex coding. How would i be able to creat a test case for this code.

global static Map<ID, Prospect__c> GetBulkFullProspect(List<ID> prospectIDs)
{
// Ask the database for ALL the prospect fields.
string queryString = URLUtilities.GetFullBaseQuery('i360__Prospect__c');
queryString += ' WHERE ID IN :ProspectIDs ';

List<Prospect__c> FullProspects = (List<Prospect__c>)(database.query(queryString));
Map<Id,Prospect__c> retMap = new Map<ID,Prospect__c>();
for(Prospect__c prospect : FullProspects)
retMap.put(prospect.id,prospect);
return retMap;

I am new to the apex coding. How would i be able to creat a test case for this code.

global static Map<ID, Prospect__c> GetBulkFullProspect(List<ID> prospectIDs)
{
// Ask the database for ALL the prospect fields.
string queryString = URLUtilities.GetFullBaseQuery('i360__Prospect__c');
queryString += ' WHERE ID IN :ProspectIDs ';

List<Prospect__c> FullProspects = (List<Prospect__c>)(database.query(queryString));
Map<Id,Prospect__c> retMap = new Map<ID,Prospect__c>();
for(Prospect__c prospect : FullProspects)
retMap.put(prospect.id,prospect);
return retMap;