Пример #1
0
class TestTelevision(unittest.TestCase):

    def setUp(self):
        self.tv = Television()

    def it_turn_on_tv(self):
        self.tv.turn_on_turn_off()
        self.tv.status |should| equal_to(True)

    def it_change_the_channel(self):
        self.tv.change_channel(10)
        self.tv.current_channnel |should| equal_to(10)

    def it_check_if_is_channel_out_of_the_range(self):
        self.tv.change_channel(51)
        self.tv.current_channnel |should| equal_to(3)

    def it_change_the_volume(self):
        self.tv.change_volume(15)
        self.tv.current_volume |should| equal_to(15)

    def it_chack_if_volume_is_above_of_the_range(self):
        self.tv.change_volume(100)
        self.tv.current_volume |should| equal_to(30)

    def it_chack_if_volume_is_below_of_the_range(self):
        self.tv.change_volume(-100)
        self.tv.current_volume |should| equal_to(0)

    def it_turn_off_tv(self):
        self.tv.status = True
        self.tv.turn_on_turn_off()
        self.tv.status |should| equal_to(False)
Пример #2
0
 def setUp(self):
     self.tv = Television()