Exemplo n.º 1
0
    def test_profit_04_notProfit(self):

        Nackadmein = School("Nackademin")
        iot = Program("IoT")
        java = Program("Java")
        Nackadmein.addProgram(iot)
        Nackadmein.addProgram(java)

        studentx = Student("john", "gatan 12", "iot", 17, 50)
        studenty = Student("peter", "gatan 2", "iot", 17, 50)
        studentz = Student("peter", "gatan 2", "iot", 17, 40)
        iot.addStudent(studentx)
        iot.addStudent(studenty)
        java.addStudent(studentz)

        staff1 = Staff("Mark", "Tomteboda 1", "Nackademin", 50)
        staff2 = Staff("Pike", "Tomteboda 3", "Nackademin", 50)
        staff3 = Staff("Moa", "Tomteboda 1", "Nackademin", 50)
        Nackadmein.addStaff(staff1)
        Nackadmein.addStaff(staff2)
        Nackadmein.addStaff(staff3)

        self.assertEqual(
            Nackadmein.getProfit(Nackadmein.sumOfPay(), Nackadmein.totalFee()),
            False)
Exemplo n.º 2
0
 def test_profit_02_sumOfPay(self):
     Nackadmein = School("Nackademin")
     staff1 = Staff("Mark", "Tomteboda 1", "Nackademin", 50)
     staff2 = Staff("Pike", "Tomteboda 3", "Nackademin", 50)
     Nackadmein.addStaff(staff1)
     Nackadmein.addStaff(staff2)
     self.assertEqual(Nackadmein.sumOfPay(), 100)
Exemplo n.º 3
0
    def test_profit_03_isProfit(self):

        Nackadmein = School("Nackademin")
        iot = Program("IoT")
        Nackadmein.addProgram(iot)

        studentA = Student("john", "gatan 12", "iot", 17, 50)
        studentB = Student("peter", "gatan 2", "iot", 17, 50)
        studentC = Student("pjotr", "gatan 2", "iot", 17, 50)
        iot.addStudent(studentA)
        iot.addStudent(studentB)
        iot.addStudent(studentC)

        staff1 = Staff("Mark", "Tomteboda 1", "Nackademin", 50)
        staff2 = Staff("Pike", "Tomteboda 3", "Nackademin", 50)
        Nackadmein.addStaff(staff1)
        Nackadmein.addStaff(staff2)

        self.assertEqual(
            Nackadmein.getProfit(Nackadmein.sumOfPay(), iot.sumOfFee()), True)