Tests should be open book, open notes, and an extensive amount of time to do the test. The questions should be such that they demonstrate an understanding of the material, not just how well you can parrot back information.
Whilst I would love tests to be open internet, this lends itself to very easy cheating. The material being taught and what notes you take about it should be enough to answer any questions posed to you about the material. Especially those that demonstrate an understanding of the material.
This is also the kind of thing that you check for in an interview - somebody who needs to look up how to write a for loop isn't going to get hired as a C programmer, and somebody who isn't familiar with Ohm's law will flunk their electronics interview. So there's a very pragmatic reason to make sure that students have the basics memorized.