Open Zerstoren opened 4 years ago
Hi @Zerstoren Can you please provide more details along with code samples (as many as possible) of what you are having trouble with and what you are trying to achieve.
As example
Bloc provider show page, but for loading data i need to get args
return BlocProvider(
builder: (_) {
widget.blocInstance.add(
ShowBoardEvent(
accountName:
Sailor.args<BoardPageArgs>(context).accountName,
),
);
return widget.blocInstance;
},
But in tests I can't mock this static method
Sailor.args<BoardPageArgs>(context)
I started using Sailor to implement routing, but I encountered a problem in tests. If Sailor can still be instantiated in Dependenct Injection and using Mockito for check the result of widgets including navigation, but methods for getting arguments are impossible mock. In order not to violate the area of responsibility, I can not move the receipt of arguments.
The simplest solution: in the instance Sailor add the same method args that will reference to the static method.