Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

7
  • Does the compiler use greedy evaluation for the && operator? Commented Jul 6, 2012 at 19:48
  • 15
    If you wrote 10 unit tests, you would be testing && operator, not your methods. Commented Jul 6, 2012 at 20:32
  • 2
    Wouldn't there only be eight tests if you tested all possible combinations? Three boolean parameters turned either on or off. Commented Jul 6, 2012 at 20:32
  • 4
    @Mert: Only if you can guarantee that the && will always be there. Commented Jul 6, 2012 at 21:55
  • 1
    I would test the intention. The intention is that conditions should be met to test to be null. This means setup all but one as true and create 3 tests with one as false each time. Commented Feb 15, 2014 at 23:47