Arrange

The arrange step is all about preparation. Make sure a logged-in user exists, populate the (in-memory) database, create instances of your fake API or other helpers. You essentially arrange everything to be in place for your testing environment. Note that this step should not involve too much setup. If you find yourself writing a lot of code in the arrange step, your test might be too broad. Or the code you're testing relies on too many other pieces of code. You can't always avoid this, but if it happens, make sure you consider refactoring your code and test to keep the quality on par with what you're trying to achieve.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset