コード例 #1
0
 @Test
 public void singlePairTest() {
   Set<String> input = new HashSet<>();
   input.add("PLNUSD");
   String output = builder.constructSelectQuery(input);
   Assert.assertEquals(
       "select id, Rate, Ask, Bid from yahoo.finance.xchange where pair in (\"PLNUSD\")", output);
 }
コード例 #2
0
 @Test
 public void multiplePairsTest() {
   Set<String> input = new HashSet<>();
   input.add("PLNUSD");
   input.add("PLNEUR");
   String output = builder.constructSelectQuery(input);
   Assert.assertTrue(
       output.startsWith("select id, Rate, Ask, Bid from yahoo.finance.xchange where pair in ("));
   Assert.assertTrue(output.contains("PLNUSD")); // \"PLNUSD\", \"PLNEUR\")", output);
   Assert.assertTrue(output.contains("PLNEUR"));
   Assert.assertTrue(output.endsWith(")"));
 }
コード例 #3
0
 @Test
 public void emptyInputTest() {
   String output = builder.constructSelectQuery(Collections.<String>emptySet());
   Assert.assertEquals("", output);
 }
コード例 #4
0
 @Test
 public void nullInputTest() {
   String output = builder.constructSelectQuery(null);
   Assert.assertEquals("", output);
 }