How would you say, in Russian?

I took the exam. I hoped that I would pass but I failed.

I can't work out how to express the 3 English verbs, take, pass and fail an exam.

Спасибо