Test Driving the API

This exercise is the culmination of everything we’ve done in the boundary layer. We’ll roll up all the work we’ve done so far. This quiz flow will depend on the data structures we defined and use the functions we established in the functional core.

The service layers will use that functional core to track state in two pieces:

  • The quiz maker, which we call the manager.

  • The quiz taker, which we call the session.

We’ll use the client APIs from those GenServers that hide those details, so we won’t see the shapes of internal call or cast messages.

All data flowing out of the API will be pure Elixir data structures, with no custom structs.

Aside from lifecycle details, this layer will show data exactly as we’ll present it to the outside world.

Setting up the alias

We’ll rev up iex -S mix. If you’ve left it open from last time, you’ll need to issue the recompile command. Then we can start to use our API:

Executable

Get hands-on with 1200+ tech skills courses.