danielsaidi / MockingKit

MockingKit is a Swift SDK that lets you easily mock protocols and classes in `Swift`.
MIT License
87 stars 7 forks source link

register result on set functions in MockUserDefaults #13

Closed sebbo176 closed 3 years ago

sebbo176 commented 3 years ago

Hi! Thank you so much for this wonderful framework. Swift cannot be tested in a good way without ut! ❤️

This PR adds a registerResult for each set method in MockUserDefaults. This way the result can be set by the thing that is tested if it calls defaults.set(value, forKey: key) and no extra registration is needed.