expectBoxHasKey static method

void expectBoxHasKey(
  1. Box box,
  2. dynamic key
)

Assert that a box contains a specific key.

Implementation

static void expectBoxHasKey(Box box, dynamic key) {
  if (!box.containsKey(key)) {
    throw AssertionError('Box should contain key: $key');
  }
}