Solution: Testing ShoppingCartCubit
View the solution for testing the ShoppingCartCubit.
We'll cover the following...
We'll cover the following...
We hope that the exercise was simple! It’s time to see a possible solution to the exercise.
Mocking ShoppingCartCubit
Mocking the ShoppingCartCubit is done by extending the MockCubit class provided to us by the bloc_test library.
Implementing whenListen()
Line 1: This creates a
MockShoppingCartCubitinstance calledshoppingCartCubit.Line 3: This provides the first parameter of the
whenListen()...