def test_lose_high_payout(self):
     config = Configuration(base_bet=1, payout=3)
     simulation = Simulation(config=config, account=self.account,
                             random_seed=5)
     # First roll with random_seed(5) is 41.85
     # Roll under value is 33.00 with payout=3
     self.assertFalse(simulation.roll(), "Won roll that should have been"
                                         " lost with high payout (3)")
 def test_lose_low_payout(self):
     config = Configuration(base_bet=1, payout=1.5)
     simulation = Simulation(config=config, account=self.account,
                             random_seed=12)
     # First roll with random_seed(12) is 77.75
     # Roll under value is 66.00 with payout=1.5
     self.assertFalse(simulation.roll(), "Won roll that should have been"
                                         " lost with low_payout (1.5)")
 def test_lose(self):
     config = Configuration(base_bet=1, payout=2)
     simulation = Simulation(config=config, account=self.account,
                             random_seed=12)
     # First roll with random_seed(12) is 77.75
     # Roll under value is 49.5 with payout=2
     self.assertFalse(simulation.roll(), "Lost roll that should have been"
                                         " won with standard payout (2)")
 def test_win_high_payout(self):
     config = Configuration(base_bet=1, payout=3)
     simulation = Simulation(config=config, account=self.account,
                             random_seed=20)
     # First roll with random_seed(20) is 24.77
     # Roll under value is 33.00 with payout=3
     self.assertTrue(simulation.roll(), "Lost roll that should have been"
                                        " won with high payout (3)")
 def test_win(self):
     config = Configuration(base_bet=1, payout=2)
     simulation = Simulation(config=config, account=self.account,
                             random_seed=20)
     # First roll with random_seed(20) is 24.77
     # Roll under value is 49.5 with payout=2
     self.assertTrue(simulation.roll(), "Lost roll that should have been"
                                        " won with standard payout (2)")
    def test_multiple_rolls(self):
        config = Configuration(base_bet=1, payout=2)

        simulation = Simulation(config=config, account=self.account,
                                random_seed=10)
        # Generated numbers with random seed of 10 are:
        # 93.61, 5.33, 70.26, 79.06, 94.71
        # A win is made by rolling a number less than 49.5 in this case
        # The sequence should then be loss, win, loss, loss, loss
        self.assertFalse(simulation.roll(), "Failed first roll of multiple"
                                            " rolls")
        self.assertTrue(simulation.roll(), "Failed second roll of multiple"
                                           " rolls")
        self.assertFalse(simulation.roll(), "Failed third roll of multiple"
                                            " rolls")
        self.assertFalse(simulation.roll(), "Failed fourth roll of multiple"
                                            " rolls")
        self.assertFalse(simulation.roll(), "Failed fifth roll if multiple"
                                            " rolls")
Ejemplo n.º 7
0
 def test_lose_low_payout(self):
     config = Configuration(base_bet=1, payout=1.5)
     simulation = Simulation(config=config,
                             account=self.account,
                             random_seed=12)
     # First roll with random_seed(12) is 77.75
     # Roll under value is 66.00 with payout=1.5
     self.assertFalse(
         simulation.roll(), "Won roll that should have been"
         " lost with low_payout (1.5)")
Ejemplo n.º 8
0
 def test_lose_high_payout(self):
     config = Configuration(base_bet=1, payout=3)
     simulation = Simulation(config=config,
                             account=self.account,
                             random_seed=5)
     # First roll with random_seed(5) is 41.85
     # Roll under value is 33.00 with payout=3
     self.assertFalse(
         simulation.roll(), "Won roll that should have been"
         " lost with high payout (3)")
Ejemplo n.º 9
0
 def test_win_high_payout(self):
     config = Configuration(base_bet=1, payout=3)
     simulation = Simulation(config=config,
                             account=self.account,
                             random_seed=20)
     # First roll with random_seed(20) is 24.77
     # Roll under value is 33.00 with payout=3
     self.assertTrue(
         simulation.roll(), "Lost roll that should have been"
         " won with high payout (3)")
Ejemplo n.º 10
0
 def test_lose(self):
     config = Configuration(base_bet=1, payout=2)
     simulation = Simulation(config=config,
                             account=self.account,
                             random_seed=12)
     # First roll with random_seed(12) is 77.75
     # Roll under value is 49.5 with payout=2
     self.assertFalse(
         simulation.roll(), "Lost roll that should have been"
         " won with standard payout (2)")
Ejemplo n.º 11
0
 def test_win(self):
     config = Configuration(base_bet=1, payout=2)
     simulation = Simulation(config=config,
                             account=self.account,
                             random_seed=20)
     # First roll with random_seed(20) is 24.77
     # Roll under value is 49.5 with payout=2
     self.assertTrue(
         simulation.roll(), "Lost roll that should have been"
         " won with standard payout (2)")
Ejemplo n.º 12
0
    def test_multiple_rolls(self):
        config = Configuration(base_bet=1, payout=2)

        simulation = Simulation(config=config,
                                account=self.account,
                                random_seed=10)
        # Generated numbers with random seed of 10 are:
        # 93.61, 5.33, 70.26, 79.06, 94.71
        # A win is made by rolling a number less than 49.5 in this case
        # The sequence should then be loss, win, loss, loss, loss
        self.assertFalse(simulation.roll(), "Failed first roll of multiple"
                         " rolls")
        self.assertTrue(simulation.roll(), "Failed second roll of multiple"
                        " rolls")
        self.assertFalse(simulation.roll(), "Failed third roll of multiple"
                         " rolls")
        self.assertFalse(simulation.roll(), "Failed fourth roll of multiple"
                         " rolls")
        self.assertFalse(simulation.roll(), "Failed fifth roll if multiple"
                         " rolls")