در حال بارگذاری ...

Arrange Act Assert Pattern0:36

That's your setup. Act, do something. And then finally, assert against that world. So notice A-A-A, the three A's. And all of your tests are going to follow this shape. Arrange, act, assert. Arrange, act, assert. And notice how I use spaces to divide each of those sections. Very, very common stuff. Okay.

Reducing Test Setup Duplication0:58

Very, very common stuff. Okay. So with that in mind, notice that the arrangement for all of our tests involve creating a tag parser. One, two, three, four, in every single case. Now in this situation, it's not really a big deal. It's a simple instantiation. But often to instantiate tag parser will require three different dependencies that need to be instantiated. And if you don't have a factory class or something like that, it can be a little bit of work.

دوست دارید گاهی خبرهای Laracasts را ایمیل کنیم؟