• Laura Livesey
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
Hi, 
I'm trying to deploy and am getting an error with a test class that works fine in sandbox - please help!  Here is the test class:

public class BTProbityCheckTest {

    static testMethod void myBTSendProbityCheckTest(){
    
    Contact newCandy = new Contact (FirstName='Fred', LastName='Flintstone', email='test@testing.com');
    insert newCandy;
   
    BT_Probity_Check__c newBTPC = new BT_Probity_Check__c(Candidate__c= newCandy.id);
    insert newBTPC; 

    PageReference pageRef = Page.BTSendProbityCheck;
    pageRef.getParameters().put('id', newBTPC.id);
    
    Test.setCurrentPageReference(pageRef);
     
    ApexPages.StandardController sc = new ApexPages.standardController(newBTPC);
    BTSendProbityCheckExtension e = new BTSendProbityCheckExtension(sc); 
    
    System.assertEquals(newBTPC.id, e.btpc.id );
    System.assertEquals('test@testing.com', e.btpcEmail);
    System.assertEquals('Fred Flintstone',e.btpc.Full_Name__c); 
    System.assertEquals(String.valueOf(newCandy.Id), e.btpcCandy);
    e.Cancel();
    
    e.SendEmail();
   
    }


The error I get when trying to deploy is:

System.AssertException: Assertion Failed: Expected: Fred Flintstone, Actual: null
Stack Trace: Class.BTProbityCheckTest.myBTSendProbityCheckTest: line 24, column 1

The line is 
System.assertEquals('test@testing.com', e.btpcEmail);

Thanks in advance. 
Hi, 
I'm trying to deploy and am getting an error with a test class that works fine in sandbox - please help!  Here is the test class:

public class BTProbityCheckTest {

    static testMethod void myBTSendProbityCheckTest(){
    
    Contact newCandy = new Contact (FirstName='Fred', LastName='Flintstone', email='test@testing.com');
    insert newCandy;
   
    BT_Probity_Check__c newBTPC = new BT_Probity_Check__c(Candidate__c= newCandy.id);
    insert newBTPC; 

    PageReference pageRef = Page.BTSendProbityCheck;
    pageRef.getParameters().put('id', newBTPC.id);
    
    Test.setCurrentPageReference(pageRef);
     
    ApexPages.StandardController sc = new ApexPages.standardController(newBTPC);
    BTSendProbityCheckExtension e = new BTSendProbityCheckExtension(sc); 
    
    System.assertEquals(newBTPC.id, e.btpc.id );
    System.assertEquals('test@testing.com', e.btpcEmail);
    System.assertEquals('Fred Flintstone',e.btpc.Full_Name__c); 
    System.assertEquals(String.valueOf(newCandy.Id), e.btpcCandy);
    e.Cancel();
    
    e.SendEmail();
   
    }


The error I get when trying to deploy is:

System.AssertException: Assertion Failed: Expected: Fred Flintstone, Actual: null
Stack Trace: Class.BTProbityCheckTest.myBTSendProbityCheckTest: line 24, column 1

The line is 
System.assertEquals('test@testing.com', e.btpcEmail);

Thanks in advance.