[ ] // declare 3 Student object
[ ] window Student stu1
[ ] window Student stu2
[ ] window Student stu3
[ ]
[ ]
[-] testcase TestStudent()
[ ] // initialize stu1
[ ] stu1.setName("Mike")
[ ] stu1.setAge(18)
[ ] stu1.setSex("Male")
[ ] // print stu1 data members
[ ] print (stu1.iAge)
[ ] print(stu1.sName)
[ ] print(stu1.sSex)
[ ] print("------------------------")
[ ]
[ ] // initialize stu2
[ ] stu2.setStudent(stu1)
[ ] // pirnt stu2 data members
[ ] print (stu2.getAge())
[ ] print(stu2.getName())
[ ] print(stu2.getSex())
[ ] print("------------------------")
文章来源于领测软件测试网 https://www.ltesting.net/