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
Shanke_PaudelShanke_Paudel 

Code Coverage

I can i associate a apex class with a apext test class?

 

My class

public class NewContact{

public void getopportunity(){
}
}

 

Test Class

@isTest
public class NewContactTest{
@isTest static void Testgetopportunity() {
}
}

 

in force.ide i do see none with Code coverage tab.

 

 

Regard's

Shanker Paudel

Subramani_SFDCSubramani_SFDC

Test Class

@isTest
public class NewContactTest{

 static void Testgetopportunity() {

 

//insert sample opp records here

 

NewContact nc=new NewContact();

test.starttest();

nc.getOpportunity();

test.stoptest();
}
}

Satyendra RawatSatyendra Rawat

Hi,

Test Class make private 

@isTest
private class NewContactTest{
static void Testgetopportunity() {

test.starttest();

NewContact newcon=new NewContact();
newcon.getOpportunity();

test.stoptest();
}
}

Abhi_TripathiAbhi_Tripathi

Hi,

 

You can refer this link for test class

http://abhithetechknight.blogspot.in/2013/10/salesforce-test-class-basics.html

 

To check you code coverage after running test class, you'll see a button "Developer Console" click on that you can then see the code coverage

 

Hit kudos and Mark as a solution if this solution helper you 

Abhi_TripathiAbhi_Tripathi

Hi,

 

You can refer this link for test class

http://abhithetechknight.blogspot.in/2013/10/salesforce-test-class-basics.html

 

To check you code coverage after running test class, you'll see a button "Developer Console" click on that you can then see the code coverage

 

Hit kudos and Mark as a solution if this solution helped you