The final type of testing we will demonstrate in this chapter is integration testing. This will use the higher-level methods of our library to ensure that related methods can successfully work together (though the level won't be so high as to have us start our server or make http requests).
One kind of integration test we could do is to check the relation between the
Get methods. If we start with nothing, we would expect that we can't
Get a key until it is been
Set, and that once
Set, it can be retrieved. We can even throw in
Delete, to then make sure that removes the expected key.
All in all, we will want to run these steps in order and make sure they do what we expect:
Get "key", expect no result
Get "key" again, expect a result
Get "key" a final time, expect no result