Advertisement
Guest User

Untitled

a guest
Jul 19th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement