• Surya@soa.com
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 6
    Replies

how to login and get session id of a salesforce using apex code.....urgent

 

I'm Trying to add contact using apex code and when i'm running test it is showing successful but Contacts are not adding

Please suggest me the solution soon.....

Here is my Apex Code

 

@isTest
Public class Enterprise{
static testMethod void AddContact()
{
   Account newAccount = new Account (name='XYZ Organization',
BillingCity ='TestCity',
BillingCountry ='TestCountry',
BillingStreet ='TestStreet',
BillingPostalCode ='t3stcd3'
);

insert newAccount;

Contact NewContact = new Contact (
FirstName = 'xyzFirst',
LastName = 'XyZLast',
Account = newAccount,
Email = 'xyzmail@mail.com'
);
}
}

 

I'm Trying to add contact using apex code and when i'm running test it is showing successful but Contacts are not adding

Please suggest me the solution soon.....

Here is my Apex Code

 

@isTest
Public class Enterprise{
static testMethod void AddContact()
{
   Account newAccount = new Account (name='XYZ Organization',
BillingCity ='TestCity',
BillingCountry ='TestCountry',
BillingStreet ='TestStreet',
BillingPostalCode ='t3stcd3'
);

insert newAccount;

Contact NewContact = new Contact (
FirstName = 'xyzFirst',
LastName = 'XyZLast',
Account = newAccount,
Email = 'xyzmail@mail.com'
);
}
}