コード例 #1
0
 @Test
 public void testGetWizardMultiPosition() {
   Player p = beanFactory.createPlayer().as();
   p.setWizard1B("1");
   p.setWizard2B("2");
   Assert.assertEquals("2.0", PlayerColumn.getWizard(p, EnumSet.of(FB, SB, TB)));
 }
コード例 #2
0
 @Test
 public void testWizardComparatorSinglePositionNullValue() {
   Player p1 = beanFactory.createPlayer().as();
   p1.setWizard2B("2");
   Player p2 = beanFactory.createPlayer().as();
   p2.setWizard1B("1");
   Comparator<Player> desc = PlayerColumn.getWizardComparator(false, EnumSet.of(FB));
   Comparator<Player> asc = PlayerColumn.getWizardComparator(true, EnumSet.of(FB));
   assertComparators(p1, p2, desc, asc);
 }
コード例 #3
0
 @Test
 public void testNumericComparatorNullValueMax() {
   Player p1 = beanFactory.createPlayer().as();
   p1.setWHIP(null);
   Player p2 = beanFactory.createPlayer().as();
   p2.setWHIP("1");
   Comparator<Player> desc = PlayerColumn.WHIP.getComparator(false);
   Comparator<Player> asc = PlayerColumn.WHIP.getComparator(true);
   assertComparators(p2, p1, desc, asc);
 }
コード例 #4
0
 @Test
 public void testNumericComparator() {
   Player p1 = beanFactory.createPlayer().as();
   p1.setSBCS("-1");
   Player p2 = beanFactory.createPlayer().as();
   p2.setSBCS("1");
   Comparator<Player> desc = PlayerColumn.SBCS.getComparator(false);
   Comparator<Player> asc = PlayerColumn.SBCS.getComparator(true);
   assertComparators(p1, p2, desc, asc);
 }
コード例 #5
0
 @Test
 public void testNonNumericComparator() {
   Player p1 = beanFactory.createPlayer().as();
   p1.setName("aaa");
   Player p2 = beanFactory.createPlayer().as();
   p2.setName("zzz");
   Comparator<Player> desc = PlayerColumn.NAME.getComparator(false);
   Comparator<Player> asc = PlayerColumn.NAME.getComparator(true);
   assertComparators(p1, p2, desc, asc);
 }
コード例 #6
0
 @Test
 public void testGetWizardAllPositions() {
   Player p = beanFactory.createPlayer().as();
   p.setWizard1B("1");
   p.setWizard2B("2");
   p.setWizard3B("3");
   p.setWizardSS("4");
   p.setWizardC("5");
   p.setWizardDH("6");
   p.setWizardOF("7");
   Assert.assertEquals("7.0", PlayerColumn.getWizard(p, EnumSet.noneOf(Position.class)));
 }
コード例 #7
0
 @Test
 public void testGetWizardSinglePosition() {
   Player p = beanFactory.createPlayer().as();
   p.setWizardP("1");
   Assert.assertEquals("1.0", PlayerColumn.getWizard(p, EnumSet.of(P)));
 }