How to test with `PersistentStateComponent`

I have a configurable like that:

 

class RainbowSettings : PersistentStateComponent<RainbowSettings> {}

It is possible to mock the `RainbowSettings` at test runtime?

0
Avatar
Permanently deleted user

But ... I need change the fake PersistentStateComponent frequently to test with different settings, is that possible to do that? As I see, in your example are all use pre-defined class ...

0

The mock PersistentStateComponent can have setters to update necessary settings.

Probably, your non-mock PersistentStateComponent has setters too. Can't you just set necessary settings before each run (and reset back to defaults in tearDown)?

0
Avatar
Permanently deleted user

Thanks a lot !

0

请先登录再写评论。