Added tests for checking order state before closing.