Closed deanmarcussen closed 1 month ago
What exactly do you need to mock in your tests?
I would have assumed that only ITimeZoneSelector
would be useful to change, because only UserTimeZoneDisplayDriver
is using UserTimeZoneService
.
and yet we extend orchard core way past what is in the orchard core repository :)
which means we use UserTimeZoneService
in many more places than just the UserTimeZoneDisplayDriver
Is that a good thing or not? I don't know, but its easier to use the orchard core services that are available, than copying hte code into our repository
Does Moq support mocking this class? Methods are not overridable so probably no possible?
Adding an interface to a public service would mean that we'll add interface to any public service when someone asks for it. We should have made this type internal if we thought it would not be used externally (and mocked). If mocking works, even if that's not easy, I would not add an interface.
Another point of view is that we may actually want it to be public if someone wants to create a feature enhances/uses this feature. In that case we could add the interface.
We triaged this issue and set the milestone according to the priority we think is appropriate (see the docs on how we triage and prioritize issues).
This indicates when the core team may start working on it. However, if you'd like to contribute, we'd warmly welcome you to do that anytime. See our guide on contributions here.
I will try to write a unit test mocking this service
annoying to mock
UserTimeZoneService