Package sixthsense

Source Code of sixthsense.SizeRTest

/**
* Authors: Dhaivat Pandya
*/
package sixthsense;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

import org.junit.Test;

import classes.SizeR;

public class SizeRTest {
  SizeR sr;
 
  public SizeRTest() {
    sr = new SizeR(1, 2);
  }
 
  @Test
  public void testValueConstructor() {
    assertTrue(sr.getCX() == 1 & sr.getCY() == 2);
  }
 
  @Test
  public void testCopyConstructor() {
    SizeR sr2 = new SizeR(sr);
    assertTrue(sr2.getCX() == sr.getCX() && sr2.getCY() == sr2.getCY());
  }
 
  @Test
  public void testGetWidthHeight() {
    assertTrue(sr.getWidth() == sr.getCX() && sr.getHeight() == sr.getCY());
  }
 
  @Test
  public void testEquals() {
    SizeR sr2 = new SizeR(1, 2);
    assertTrue(sr2.equals(sr) && sr.equals(sr2));
  }
 
  @Test
  public void testUnequal() {
    SizeR sr2 = new SizeR(2, 4);
    assertFalse(sr2.equals(sr));
  }
}
TOP

Related Classes of sixthsense.SizeRTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.