and<T> function
Implementation
FutureOr<T> and<T>(String description, FutureOr<T> Function() body) {
final state = Zone.current[stateKey] as State?;
if (state == null) {
throw Exception('Use and method after given, when, whenThrows or then');
}
switch (state.key) {
case givenKey:
return given(description, body);
case whenKey:
return when(description, body);
case thenKey:
return then(description, body);
case null:
throw Exception('Use and method after given, when or then');
default:
throw UnimplementedError();
}
}