Moved an assert in a unit test