<reponame>mathiasbynens/pogopowerupcost<filename>pogopowerupcost/tests/test-powerupcost.py<gh_stars>1-10
#!/usr/bin/env python
# coding=utf-8

from unittest import TestCase

from pogopowerupcost import calculate_powerup_cost

class TestCalculation(TestCase):

	def test_scenario_1(self):
		cost = calculate_powerup_cost(1, 20)
		self.assertEqual(cost['stardust'], 45000)
		self.assertEqual(cost['candy'], 56)

	def test_scenario_2(self):
		cost = calculate_powerup_cost(4.5, 20)
		self.assertEqual(cost['stardust'], 43000)
		self.assertEqual(cost['candy'], 49)

	def test_scenario_3(self):
		cost = calculate_powerup_cost(36.5, 39)
		self.assertEqual(cost['stardust'], 44000)
		self.assertEqual(cost['candy'], 58)

	def test_scenario_4(self):
		cost = calculate_powerup_cost(30.0, 38.5)
		self.assertEqual(cost['stardust'], 121000)
		self.assertEqual(cost['candy'], 140)

#!/usr/bin/env python
# coding=utf-8

from unittest import TestCase

from pogopowerupcost import calculate_powerup_cost

class TestCalculation(TestCase):

	def test_scenario_1(self):
		cost = calculate_powerup_cost(1, 20)
		self.assertEqual(cost['stardust'], 45000)
		self.assertEqual(cost['candy'], 56)

	def test_scenario_2(self):
		cost = calculate_powerup_cost(4.5, 20)
		self.assertEqual(cost['stardust'], 43000)
		self.assertEqual(cost['candy'], 49)

	def test_scenario_3(self):
		cost = calculate_powerup_cost(36.5, 39)
		self.assertEqual(cost['stardust'], 44000)
		self.assertEqual(cost['candy'], 58)

	def test_scenario_4(self):
		cost = calculate_powerup_cost(30.0, 38.5)
		self.assertEqual(cost['stardust'], 121000)
		self.assertEqual(cost['candy'], 140)
#!/usr/bin/env python # coding=utf-8