Results 1 to 2 of 2
  1. #1
    khanhnq is offline Member
    Join Date
    Jan 2013
    Posts
    3
    Rep Power
    0

    Default Using assertEquals ( ...) in class Test...

    Hi all,
    I'm a beginner of JAVA OOP. I have a problem when writting a code in NetBean IDE. Here is my code:

    package model;

    import static org.junit.Assert.assertEquals;

    public class OrganizerTest
    {
    private Organizer organizer0 = new Organizer(11, 10);
    private Organizer organizer1 = new Organizer(11, 11);
    private Organizer organizer2 = new Organizer(11, 100);

    public void computeTeams()
    {
    assertEquals(0, organizer0.computeTeams());
    assertEquals(1, organizer1.computeTeams());
    assertEquals(9, organizer2.computeTeams());
    }

    public void leftOverPerPlayers()
    {
    assertEquals(10, organizer0.computeLeftOverPlayers());
    assertEquals(0, organizer1.computeLeftOverPlayers());
    assertEquals(1, organizer2.computeLeftOverPlayers());
    }
    }

    My problem is assertEquals. It said that it can not find method assertEquals(int , int )... But it not a method... and i'm already to import static org.unit.Assert.assertEquals...

    Please help,

    Best Regards,

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    12,047
    Rep Power
    23

Similar Threads

  1. TestCase error (AssertEquals)
    By gomdohri in forum New To Java
    Replies: 5
    Last Post: 09-19-2011, 06:20 AM
  2. Help with this test class
    By fsuarjun03 in forum New To Java
    Replies: 10
    Last Post: 06-20-2011, 03:56 AM
  3. JUnit test - AssertEquals
    By dellacpa in forum New To Java
    Replies: 2
    Last Post: 11-21-2010, 10:19 PM
  4. Creating a test class
    By joshft91 in forum New To Java
    Replies: 6
    Last Post: 11-01-2010, 06:30 AM
  5. JUNIT testing assertEquals function
    By Drun in forum New To Java
    Replies: 7
    Last Post: 01-22-2010, 07:08 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •