File tree Expand file tree Collapse file tree 2 files changed +293
-220
lines changed
RandomJSONRPC/src/org/random Expand file tree Collapse file tree 2 files changed +293
-220
lines changed Original file line number Diff line number Diff line change 1+ package org .random .test ;
2+
3+ import static org .junit .Assert .assertNotNull ;
4+ import static org .junit .Assert .assertTrue ;
5+
6+ import org .junit .Assert ;
7+ import org .junit .BeforeClass ;
8+ import org .junit .Test ;
9+ import org .random .util .RandomOrgRandom ;
10+
11+ /** A set of tests for RandomOrgRandom.java
12+ **/
13+ public class RandomOrgRandomBasicTest {
14+
15+ private static RandomOrgRandom random ;
16+
17+ private static final String API_KEY_1 = "YOUR_API_KEY_HERE" ;
18+
19+ @ BeforeClass
20+ public static void testSetup () {
21+ random = new RandomOrgRandom (API_KEY_1 );
22+ }
23+
24+ @ Test
25+ public void testIntegerRange (){
26+ try {
27+ int i = random .nextInt (10 );
28+ assertNotNull (i );
29+ assertTrue (i >= 0 );
30+ assertTrue (i < 10 );
31+ } catch (Exception e ) {
32+ Assert .fail ("Networking error: " + e .getClass ().getName () + ":" + e .getMessage ());
33+ }
34+ }
35+ }
You can’t perform that action at this time.
0 commit comments