• Akash Hanchate
  • NEWBIE
  • 0 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
Hi,
I have written the apex class for addition of two numbers. but for writing the test class i have issue.
Program is
--------------
public class Add 
{    
public integer a;
public integer b;
public integer c;
public integer addt()
{
    c=a+b; 
    system.debug('the result is'+c);
    return c;
}      
}

My test class
-----------------
@istest
public class Addtest
{
static testmethod void testadd()
{
    Add ad=new Add();
    integer res=ad.addt();
    system.assertEquals(res);
}
}
the test class is throwing error as
"Method does not exist or incorrect signature: void assertEquals(Integer) from the type System"

Any guidance please

Thanks in advance.