Added a test for throwing an exception when negative numbers are detected