@Test
 public void player_can_place_bets_on_different_fields_and_with_different_values()
     throws Exception {
   rt.placeBet(p, Field.forNumber(17), 200);
   rt.placeBet(p, Field.forNumber(2), 600);
   rt.placeBet(p, Field.forNumber(30), 1000);
   assertEquals(new Bet(p, 200), rt.betsByField(Field.forNumber(17)).get(0));
   assertEquals(new Bet(p, 600), rt.betsByField(Field.forNumber(2)).get(0));
   assertEquals(new Bet(p, 1000), rt.betsByField(Field.forNumber(30)).get(0));
 }
Ejemplo n.º 2
0
 @Test
 public void player_can_place_bets_on_different_fields_and_with_different_values()
     throws TooManyChipsException, TableFullException {
   rt.placeBet(p, 17, 200);
   rt.placeBet(p, 2, 600);
   rt.placeBet(p, 30, 1000);
   assertEquals(new Bet(p, 200), rt.betsByField(17).get(0));
   assertEquals(new Bet(p, 600), rt.betsByField(2).get(0));
   assertEquals(new Bet(p, 1000), rt.betsByField(30).get(0));
 }
 @Test
 public void
     Total_number_of_chips_is_limited_by_the_table_and_the_table_can_refuse_a_bet_if_there_are_too_many_chips()
         throws Exception {
   RouletteTable rt = new RouletteTable(300, rng, timer, walletService);
   Player p = new Player();
   rt.placeBet(p, Field.forNumber(17), 200);
   boolean exceptionThrown = false;
   try {
     rt.placeBet(new Player(), Field.forNumber(20), 200);
   } catch (TooManyChipsException e) {
     exceptionThrown = true;
   }
   // the following should be true
   assertEquals(0, rt.betsByField(Field.forNumber(20)).size());
   assertTrue(exceptionThrown);
 }
 @Test
 public void player_can_place_split_bets_which_cover_both_fields() throws Exception {
   rt.placeBet(p, new Field[] {Field.forNumber(1), Field.forNumber(2)}, 10);
   assertEquals(new Bet(p, 10, BetType.SPLIT), rt.betsByField(Field.forNumber(1)).get(0));
   assertEquals(new Bet(p, 10, BetType.SPLIT), rt.betsByField(Field.forNumber(2)).get(0));
 }
 @Test
 public void player_can_place_bet_on_ODD_and_EVEN() throws Exception {
   rt.placeBet(p, Field.ODD, 10);
   assertEquals(new Bet(p, 10), rt.betsByField(Field.ODD).get(0));
 }
 @Test
 public void player_can_place_bets_on_number_fields() throws Exception {
   rt.placeBet(p, Field.forNumber(17), 200);
   assertEquals(new Bet(p, 200), rt.betsByField(Field.forNumber(17)).get(0));
 }
Ejemplo n.º 7
0
 @Test
 public void player_can_place_bets_on_number_fields()
     throws TooManyChipsException, TableFullException {
   rt.placeBet(p, 17, 200);
   assertEquals(new Bet(p, 200), rt.betsByField(17).get(0));
 }