Hi, I read in tornadofx guide that Views, Control...
# tornadofx
a
Hi, I read in tornadofx guide that Views, Controllers and Models are Singeltones, If I would like to mock a controller or a model for testing, how I can do that?
r
You can look into `Scope`s and see if that will do it for you, but I tend to prefer the tried and true method of creating an interface that the controller implements, then you can just mock the interface.
👍 1
I'm not saying it's a better (or even good) solution, just that it's what I've done for years and never really bothered to try anything new 🙂
a
Thanks, I will try both, and see witch one will work well for me!🤔
If I go for the controller interface way, how I can inject the mocked controller to the view?