Throw StateError explicitly instead of using assert. Document thrown exception.
Moved lib/src/testing to lib/testing/src. Moved top level testing files from lib/ to lib/testing.