It sounds like you may have test anxiety, where testing situations trigger anxiety symptoms. When someone has an anxiety disorder, you can get an anxiety attack when you are exposed to you feared trigger. Anxiety attacks are different than panic attacks in that anxiety attacks are triggered, whereas panic attacks are random, and come about out of nowhere, spontaneously. Anxiety attacks are characterized by racing heart beat, shortness of breath, lump in the throat, butterflies in the stomach, headache, and nausea.
You can get an anxiety attack with any of the following anxiety disorders: specific phobia, social phobia, panic disorder, post traumatic stress disorder (PTSD), and obsessive compulsive disorder (OCD). Panic attacks only come about with panic disorder.