class TestGuest(unittest.TestCase): def setUp(self): self.guest = Guest('Cozza', 18.50, 'Black & White', 'In Flames') def test_guest_has_name(self): self.assertEqual('Cozza', self.guest.name) def test_guest_has_wallet_balance(self): self.assertEqual(18.50, self.guest.wallet_balance) def test_guest_can_remove_cash_from_wallet(self): self.guest.remove_cash_from_wallet(10.00) self.assertEqual(8.50, self.guest.wallet_balance) def test_guest_has_favourite_song_name(self): self.assertEqual('Black & White', self.guest.fave_song_name) def test_guest_has_favourite_song_artist(self): self.assertEqual('In Flames', self.guest.fave_song_artist)
class TestGuest(unittest.TestCase): def setUp(self): self.room_2 = Room("Studio 54", 45.00) self.guest_1 = Guest("Mick", "Jagger", 20, 12000.00, "Dead Flowers") self.guest_2 = Guest("Justin", "Bieber", 16, 5.00, "Sorry") self.guest_3 = Guest("Joni", "Mitchell", 21, 100.00, "Juice") def test_guest_has_whole_name(self): self.assertEqual("Justin", self.guest_2.get_guest_first_name()) self.assertEqual("Bieber", self.guest_2.get_guest_surname()) def test_guest_has_age(self): self.assertEqual(20, self.guest_1.get_guest_age()) def test_guest_has_funds(self): self.assertEqual(100.00, self.guest_3.wallet_cash_count()) def test_remove_cash_from_wallet(self): self.guest_1.remove_cash_from_wallet(self.room_2.entry_fee) self.assertEqual(11955.00, self.guest_1.wallet_cash_count()) def test_cheer(self): self.cheer() self.assertEqual("CHOON!", self.guest_3.cheer())