Guest User

Untitled

a guest
Jul 19th, 2019
61
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. let mockedClass = MockStudentManager()
  2. let studentToTest = someStudent //where someStudent is an instance of Student
  3.  
  4. stub(mockStudentManager) { stub in
  5.  
  6. //Two Objects are considered equal here when name, age and CourseName are equal
  7. when(stub.doesSomethingToStudent(student: equal( to: student,
  8. for: EqualityDescriptor(\Student.name),
  9. EqualityDescriptor(\Student.age),
  10. EqualityDescriptor(\Student.course.couseName)
  11. )
  12. )
  13. ).thenDoNothing()
  14. }
RAW Paste Data