class Person: # a structure that represents a person
    """
    This class represents a person. A person has the following attributes: first name, last name, year of birth.
    """
    def __init__(self,firstName,lastName,yearOfBirth): #to instantiate a person
        self.firstName = firstName
        self.lastName = lastName
        self.yearOfBirth = yearOfBirth
    
    def getFirstName(self): 
        """ function for a person to return their first name """
        return self.firstName        
    
    def getLastName(self): 
        """ function for a person to return their last name """
        return self.lastName

    def getYearOfBirth(self): 
        """ function for a person to return its year of birth """
        return self.yearOfBirth
        
#create an instance that represents a person named John Doe        
john = Person("John", "Doe", 1945)

########################## Tests ######################

#tests for persons defined in an OO manner

import unittest

class OOPersonTests(unittest.TestCase):
    def setUp(self):
        #create an instance that represents a person named John Doe        
        self.john = Person("John", "Doe", 1945)
        
        #create an instance of elvis presley
        self.elvis = Person("Elvis", "Presley", 1935)

        
    def test_firstname(self):
        self.assertEquals("John", self.john.getFirstName())
        self.assertEquals("Elvis", self.elvis.getFirstName())
        
    def test_lastname(self):
        self.assertEquals("Doe", self.john.getLastName())
        self.assertEquals("Presley", self.elvis.getLastName())
        
    def test_yearofbirth(self):
        self.assertEquals(1945, self.john.getYearOfBirth())
        self.assertEquals(1935, self.elvis.getYearOfBirth())
        
suite = unittest.TestLoader().loadTestsFromTestCase(OOPersonTests)
unittest.TextTestRunner(verbosity=2).run(suite)