MakeAWishFoundation / SwiftyMocky

Framework for automatic mock generation. Adds a set of handy methods, simplifying testing. One of the best and most complete solutions, including generics support and much more.
MIT License
1.03k stars 104 forks source link

Feature Request: View controller and view mocking support. #337

Open erneestoc opened 1 year ago

erneestoc commented 1 year ago

I've been playing with the idea of allowing automocks of some core components of iOS applications.

For example:

protocol MyAwesomeViewControllerType: UIViewController, Automockable {
    init(myImportantParameter: Bool)
    func someUsefulFunction()
}

In this way I could register types on my DI system, and inject fake types on my test. The views or view controller would have a watermark with the names of the controller in case we use snapshot testing, and would allow us to assert the behavior we're using.

Any thoughts?