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

    def setUp(self):
        self.square = Square(5)

    def it_check_its_its_side(self):
        self.square.side |should| equal_to(5)

    def it_check_its_its_area(self):
        self.square.area() |should| equal_to(25)

    def it_change_side(self):
        self.square.change_side(7)
        self.square.side |should| equal_to(7)

    def it_change_area(self):
        self.square.change_side(7)
        self.square.area() |should| equal_to(49)
Пример #2
0
 def setUp(self):
     self.square = Square(5)