Fix order of test statement

Add test for if statement.