While this question has the distinct hallmark of an XY problem, the essential point of the question is, how can I get a different value while I'm testing my code as opposed to when I'm actually running the code?
Fundamentally speaking, this can be accomplished in a myriad of ways:
- Mock the service that generates that integer and supply it with whatever integer you want
- Inject the service in design, and replace it with your own while testing, so you can then generate whatever integer you wish
- Hard-coding it (if you really had to)
If your question were clearer, you could get an explicit answer on how to solve your problem. This is just a generic remark to that effect.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…