class TestIntervalStrategy(unittest.TestCase):

    def setUp(self):
        super(TestIntervalStrategy, self).setUp()
        self.strat = IntervalStrategy()

    @with_params(egg_strength=1)
    def test_eggstrength_1(self, eggs, building_size):
        self.assertEqual(self.strat.strategize(eggs, building_size), 1)

    @with_params(egg_strength=50)
    def test_eggstrength_50(self, eggs, building_size):
        self.assertEqual(self.strat.strategize(eggs, building_size), 50)

    @with_params(egg_strength=99)
    def test_eggstrength_99(self, eggs, building_size):
        self.assertEqual(self.strat.strategize(eggs, building_size), 99)

    @with_params(egg_strength=100)
    def test_eggstrength_100(self, eggs, building_size):
        self.assertEqual(self.strat.strategize(eggs, building_size), 100)

    @with_params(egg_strength=101)
    def test_eggstrength_101(self, eggs, building_size):
        self.assertEqual(self.strat.strategize(eggs, building_size), 100)
Пример #2
0
class TestIntervalStrategy(unittest.TestCase):
    def setUp(self):
        super(TestIntervalStrategy, self).setUp()
        self.strat = IntervalStrategy()

    @with_params(egg_strength=1)
    def test_eggstrength_1(self, eggs, building_size):
        self.assertEqual(self.strat.strategize(eggs, building_size), 1)

    @with_params(egg_strength=50)
    def test_eggstrength_50(self, eggs, building_size):
        self.assertEqual(self.strat.strategize(eggs, building_size), 50)

    @with_params(egg_strength=99)
    def test_eggstrength_99(self, eggs, building_size):
        self.assertEqual(self.strat.strategize(eggs, building_size), 99)

    @with_params(egg_strength=100)
    def test_eggstrength_100(self, eggs, building_size):
        self.assertEqual(self.strat.strategize(eggs, building_size), 100)

    @with_params(egg_strength=101)
    def test_eggstrength_101(self, eggs, building_size):
        self.assertEqual(self.strat.strategize(eggs, building_size), 100)
 def setUp(self):
     super(TestIntervalStrategy, self).setUp()
     self.strat = IntervalStrategy()
Пример #4
0
 def setUp(self):
     super(TestIntervalStrategy, self).setUp()
     self.strat = IntervalStrategy()