Is it possible to make a boolean if statement, that says if (a method that has a void data type) = true { then do the following?
or would the method need to be a boolean as well?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The if-expression has to have boolean type. If it is just a call, you need to call a method that returns boolean. If you are comparing to true, generally a waste of time, you also need a boolean expression.
What are you trying to test? If you just want to find out if it completes without an exception, you can use:
If you are trying to test something else about the method’s execution, you need to specify what you are testing.