Ejemplo n.º 1
0
  public void testConstructor2b() {
    LongRange nr = new LongRange(long8, long10);
    assertSame(long8, nr.getMinimumNumber());
    assertSame(long10, nr.getMaximumNumber());

    nr = new LongRange(long10, long8);
    assertSame(long8, nr.getMinimumNumber());
    assertSame(long10, nr.getMaximumNumber());

    nr = new LongRange(long8, long10);
    assertSame(long8, nr.getMinimumNumber());
    assertEquals(long10, nr.getMaximumNumber());

    // not null
    try {
      new LongRange(long8, null);
      fail();
    } catch (IllegalArgumentException ex) {
    }
    try {
      new LongRange(null, long8);
      fail();
    } catch (IllegalArgumentException ex) {
    }
    try {
      new LongRange(null, null);
      fail();
    } catch (IllegalArgumentException ex) {
    }
  }
Ejemplo n.º 2
0
  public void testConstructor2a() {
    LongRange nr = new LongRange(8L, 10L);
    assertEquals(long8, nr.getMinimumNumber());
    assertEquals(long10, nr.getMaximumNumber());

    nr = new LongRange(10L, 8L);
    assertEquals(long8, nr.getMinimumNumber());
    assertEquals(long10, nr.getMaximumNumber());
  }
Ejemplo n.º 3
0
  public void testConstructor1b() {
    LongRange nr = new LongRange(long8);
    assertSame(long8, nr.getMinimumNumber());
    assertSame(long8, nr.getMaximumNumber());

    Range r = new LongRange(nonComparableNumber);

    try {
      new LongRange(null);
      fail();
    } catch (IllegalArgumentException ex) {
    }
  }