Is it professional for a professor to ask "surprise" questions on a test? To clarify, I am asking if it's professional to ask questions that while relevant to the subject/course, and are related to the topic, but have not been discussed in class, assigned as homework, reading, etc. and are also not related to any prerequisite class that the students should already know. I am also not asking about "gotcha" questions where it's a quick "know it or not" fact, but rather an entire procedure, proof, or concept of some sort. 

For example in class, using a formula from the textbook to solve problems, but on the exam asking for a proof of the formula that has been used.

Another example - in a foreign language class, asking about a never-before-seen word that may be related to some other, studied words or that has a similar sound/meaning in the native language.

Do such questions "make students think out of the box", or are they more likely to discourage students when they struggle with them? While in the real world there may be many problems similar to this where the problem is completely new, is this something that should be taught in an unrelated class? 

Does it matter if the test in question will be graded on a curve where even if a student doesn't answer the question correctly at all, they could still get a good grade?

P.S. - this question was prompted by the comments in this answer
I don't see a reasonable answer beyond "it depends."  It depends on the question: some surprise questions are not actually so difficult and could reasonably be asked on a test with no special preparation, while others are very difficult indeed.  It also depends on the students: you can demand more of experienced and talented students than you can of typical beginners.

There's certainly no rule that says you can only ask test questions that are similar to previous questions the students have seen.  Sometimes asking unusual questions can be an excellent way to judge how well students have mastered the material.  At the same time, test questions that are too unfamiliar or difficult can be unproductive.  This is a balancing act that can be solved in many different ways, depending on the style of the person writing the test.