refactored test to use assert