assalam alaikoum Alhamdoulilah I am a good student, I study hard but one day I received the test from a friend who took the test before me, like one day before. She hided it from the teacher she said and took it. She gave it to me and it is very probable that our test will be the same. The teacher does not change it most of the time. I throw the test away and thought it was cheating. Did I do the right thing? In this case is it haram to see the test that could be the same even though I studied for it? I am asking if somehow it happens again jazaka allah khair wa salam alaikoum
All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger.
First of all, we thank you for being keen to learn your religion and for refusing to cheat, as cheating is forbidden. The Prophet said: "Whoever cheats is not one of us." [Muslim] Therefore, you did well by avoiding what could lead to cheating.
You should have advised your class mates, as advice is the essence of religion, and you should have refused to take the examination paper that was given to you, because by accepting it, you are encouraging others to cheat. By refusing to take the test paper, you prevent yourself from cheating and prevent the devil from whispering to you and luring you to cheat.
To conclude, you acted in a correct way and you should avoid anything which could lead to cheating, and you should advise all Muslims.
For more benefit, please refer to Fatwa 86185.
You can search for fatwa through many choices