/*
 * ContadorTest.java
 * JUnit based test
 *
 * Created on March 29, 2004, 7:55 AM
 */

import junit.framework.*;

/**
 *
 * @author do008548
 */
public class ContadorTest extends TestCase {
    
    public ContadorTest(java.lang.String testName) {
        super(testName);
    }
    
    public static void main(java.lang.String[] args) {
        junit.textui.TestRunner.run(suite());
    }
    
    public static Test suite() {
        TestSuite suite = new TestSuite(ContadorTest.class);
        return suite;
    }
    private Contador cont;
    protected void setUp() throws Exception {
        cont= new Contador(0);}
    public void testInc() {
        cont.inc();
        Assert.assertEquals("inc fallo",1,cont.getValor());
    }
    public void testDec() {
        cont.dec();
        Assert.assertEquals("dec fallo",-1,cont.getValor());
    }
    public void testGetValor() {
      Assert.assertEquals("getValor fallo",0,cont.getValor());
    }
    public void testSetValor() {
       cont.setValor(5);
       Assert.assertEquals("setValor fallo",5,cont.getValor());
    }
    
    // Add test methods here, they have to start with 'test' name.
    // for example:
    // public void testHello() {}
    
    
}
