The verse 3:45 of the Quran is as follows:
“And when the angels said: ‘O Mary! God gives you the glad tidings of a word from Him: his name shall be Messiah, Jesus, the son of Mary. He shall be highly honored in this world and in the hereafter, and shall be one of those near stationed to God. ” (Al-e-Imran/Family of Imran 3:45)
Jesus (pbuh) had been created in accordance with the mission he would be assigned to; and to Mary it was revealed that he was going to be a highly gifted son. On the other hand, this revelation does not guarantee that Jesus (pbuh) would certainly pass the test. Because, the oath in the verse below was taken from him as well:
“And call to mind, (O Prophet), when We took the oath from all Prophets; and also from you (Muhammad) and Noah and Abraham, Moses, and Jesus the son of Mary. We took from them a solemn oath so that God may question the truthful about their truthfulness. As for those who ignore (this), We have prepared a grievous chastisement for them.” (Al-Ahzaab/The Allies 33:7-8)
Let’s consider this verse as well:
“(Oh Muhammad) it was revealed to you and to those (prophets) before you: “If you associate partners with God, all of your deeds will surely come to naught and you will certainly be among the losers.” (Az-Zumar/The Companies 39:65)
So, all of the prophets were chosen, but also tested. If they had placed other beings between themselves and God in order to ask for help from them or worship them, or if they had ignored God’s commands, they would surely fail the test, and be punished severely.