예제 #1
0
class PersonTests(unittest.TestCase):
    def setUp(self):
        self.p = Person("Harry", "Morgan")

    def test_get_name(self):
        self.assertEqual("Morgan, Harry", self.p.get_name())

    def test_get_name_when_empty_constructor(self):
        new_person = Person()
        self.assertEqual("unknown", new_person.get_name())
예제 #2
0
class PersonTests(unittest.TestCase):
    def setUp(self):
        self.p = Person("Harry", "Morgan")

    def test_get_name(self):
        self.assertEqual("Morgan, Harry", self.p.get_name())

    def test_get_name_when_empty_constructor(self):
        new_person = Person()
        self.assertEqual("unknown", new_person.get_name())
예제 #3
0
 def test_get_name_when_empty_constructor(self):
     new_person = Person()
     self.assertEqual("unknown", new_person.get_name())
예제 #4
0
 def setUp(self):
     self.p = Person("Harry", "Morgan")
예제 #5
0
 def setUp(self):
     self.p = Person("Harry", "Morgan")
예제 #6
0
 def test_get_name_when_empty_constructor(self):
     new_person = Person()
     self.assertEqual("unknown", new_person.get_name())