Using ProviderContainer
This might be where you are getting a bit more confused. Well I agree, it is a bit more confusing here!
Our application is written with Riverpod meaning that our controllers, services, and repositories are shared with the help of it. These classes during the application's usage are stored in the ProviderScope which is located in the main.dart file. ProviderContainer works the same way as ProviderScope or actually. ProviderScope implicitly creates a ProviderContainer for you!
To simulate unit tests as close to our real code as possible, it's good to use Riverpod during our tests as that also tests the global providers we have in our app. Arguably you could do the same thing with the service class from the previous lecture but personally, I prefer just doing it for my StateNotifiers or other providers that don't simply just return a normal class.
SetUp and TearDown
These two methods help us with setting up the tests. For example, instead of instantiating the ProviderContainer during every test, we can simply do this in the SetUp method which will be called before every single test. The same is true for the TearDown which will let us dispose etc after every test!