SHARE
TWEET

Untitled

a guest Jul 19th, 2019 59 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
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top