Пример #1
0
 /**
  * Test a simple multiple value-taking method call, that returns whether it got the expected
  * values.
  */
 public void test_takeCoolHandLuke() {
   assertTrue(
       StaticNonce.takeCoolHandLuke(
           1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
           25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
           47, 48, 49, 50));
 }
Пример #2
0
 /** Test a simple value-returning (but otherwise no-op) method call. */
 public void test_returnShortArray() {
   short[] array = StaticNonce.returnShortArray();
   assertSame(short[].class, array.getClass());
   assertEquals(3, array.length);
   assertEquals(10, array[0]);
   assertEquals(20, array[1]);
   assertEquals(30, array[2]);
 }
Пример #3
0
 /** Test a simple value-returning (but otherwise no-op) method call. */
 public void test_returnStringArray() {
   String[] array = StaticNonce.returnStringArray();
   assertSame(String[].class, array.getClass());
   assertEquals(100, array.length);
   assertEquals("blort", array[0]);
   assertEquals(null, array[1]);
   assertEquals("zorch", array[50]);
   assertEquals("fizmo", array[99]);
 }
Пример #4
0
 /**
  * Test a simple multiple value-taking method call, that returns whether it got the expected
  * values.
  */
 public void test_takeOneOfEach() {
   assertTrue(
       StaticNonce.takeOneOfEach(
           (boolean) false,
           (byte) 1,
           (short) 2,
           (char) 3,
           (int) 4,
           5L,
           "six",
           7.0f,
           8.0,
           new int[] {9, 10}));
 }
Пример #5
0
 /** Test a simple value-returning (but otherwise no-op) method call. */
 public void test_returnByte() {
   assertEquals(123, StaticNonce.returnByte());
 }
Пример #6
0
 /** Test a simple value-taking method call, that returns whether it got the expected value. */
 public void test_takeChar() {
   assertTrue(StaticNonce.takeChar((char) 999));
 }
Пример #7
0
 /** Test a simple value-returning (but otherwise no-op) method call. */
 public void test_returnBoolean() {
   assertEquals(true, StaticNonce.returnBoolean());
 }
Пример #8
0
 /** Test a simple value-returning (but otherwise no-op) method call. */
 public void test_returnNull() {
   assertNull(StaticNonce.returnNull());
 }
Пример #9
0
 /** Test a simple value-taking method call, that returns whether it got the expected value. */
 public void test_takeBoolean() {
   assertTrue(StaticNonce.takeBoolean(true));
 }
Пример #10
0
 /** Test a simple value-returning (but otherwise no-op) method call. */
 public void test_returnInt() {
   assertEquals(12345678, StaticNonce.returnInt());
 }
Пример #11
0
 /** Test a simple value-returning (but otherwise no-op) method call. */
 public void test_returnFloat() {
   assertEquals(-98765.4321F, StaticNonce.returnFloat());
 }
Пример #12
0
 /** Test a simple value-taking method call, that returns whether it got the expected value. */
 public void test_takeString() {
   assertTrue(StaticNonce.takeString("fuzzbot"));
 }
Пример #13
0
 /**
  * Test a simple value-taking method call, that returns whether it got the expected value. In
  * particular, this test passes the class the method is defined on.
  */
 public void test_takeThisClass() {
   assertTrue(StaticNonce.takeThisClass(StaticNonce.class));
 }
Пример #14
0
 /** Test a simple value-taking method call, that returns whether it got the expected value. */
 public void test_takeDouble() {
   assertTrue(StaticNonce.takeDouble(999888777.666555));
 }
Пример #15
0
 /** Test a simple value-taking method call, that returns whether it got the expected value. */
 public void test_takeNull() {
   assertTrue(StaticNonce.takeNull(null));
 }
Пример #16
0
 /** Test a simple value-taking method call, that returns whether it got the expected value. */
 public void test_takeFloat() {
   assertTrue(StaticNonce.takeFloat(-9988.7766F));
 }
Пример #17
0
 /** Test a simple value-taking method call, that returns whether it got the expected value. */
 public void test_takeLong() {
   assertTrue(StaticNonce.takeLong(999888777666555444L));
 }
Пример #18
0
 /** Test a simple value-taking method call, that returns whether it got the expected value. */
 public void test_takeInt() {
   assertTrue(StaticNonce.takeInt(-999888777));
 }
Пример #19
0
 /** Test a simple value-returning (but otherwise no-op) method call. */
 public void test_returnShort() {
   assertEquals(-12345, StaticNonce.returnShort());
 }
Пример #20
0
 /**
  * Test a simple multiple value-taking method call, that returns whether it got the expected
  * values.
  */
 public void test_takeIntLong() {
   assertTrue(StaticNonce.takeIntLong(914, 9140914091409140914L));
 }
Пример #21
0
 /** Test a simple value-returning (but otherwise no-op) method call. */
 public void test_returnChar() {
   assertEquals(34567, StaticNonce.returnChar());
 }
Пример #22
0
 /**
  * Test a simple multiple value-taking method call, that returns whether it got the expected
  * values.
  */
 public void test_takeLongInt() {
   assertTrue(StaticNonce.takeLongInt(-4321L, 12341234));
 }
Пример #23
0
 /** Test a simple value-returning (but otherwise no-op) method call. */
 public void test_returnLong() {
   assertEquals(-1098765432109876543L, StaticNonce.returnLong());
 }
Пример #24
0
 /**
  * Test a simple value-returning (but otherwise no-op) method call, that returns the class that
  * the method is defined on.
  */
 public void test_returnInstance() {
   StaticNonce nonce = StaticNonce.returnInstance();
   assertSame(StaticNonce.class, nonce.getClass());
 }
Пример #25
0
 /** Test a simple value-returning (but otherwise no-op) method call. */
 public void test_returnDouble() {
   assertEquals(12345678.9, StaticNonce.returnDouble());
 }
Пример #26
0
 /** Test a simple value-taking method call, that returns whether it got the expected value. */
 public void test_takeByte() {
   assertTrue(StaticNonce.takeByte((byte) -99));
 }
Пример #27
0
 /** Test a simple value-returning (but otherwise no-op) method call. */
 public void test_returnString() {
   assertEquals("blort", StaticNonce.returnString());
 }
Пример #28
0
 /** Test a simple no-op and void-returning method call. */
 public void test_nop() {
   StaticNonce.nop();
 }
Пример #29
0
 /**
  * Test a simple value-returning (but otherwise no-op) method call, that returns the class that
  * the method is defined on.
  */
 public void test_returnThisClass() {
   assertSame(StaticNonce.class, StaticNonce.returnThisClass());
 }
Пример #30
0
 /** Test a simple value-taking method call, that returns whether it got the expected value. */
 public void test_takeShort() {
   assertTrue(StaticNonce.takeShort((short) 19991));
 }