Vayafkichsau ess Yosef ess kitanto ess kisonas hapasim asher alav. Vayikachuhu vayashlichu osso haborah (37:23-24)
Vayazov bigdo b'yada vayanas (39:12)
Yosef lost his clothes twice; once through his brothers when they threw him into the pit, and once when he ran away from Mrs. Potifar.
A nisayon is a time when the person's innermost essence is exposed. That is when we/Hashem can see where the person is REALLY holding. Clothes cover the wearer; they are symbolic of the coverings that a person is hidden by.
Yosef had two styles of nisyonos: (1) the test of losing everything, His brothers abandoning him in a pit in the desert. And (2) his master's wife trying to raise him high.
He withstood both of them. He was shown in his uncovered essence. His 'coverings' were removed!
The word "nisayon" can be derived from the word "nes". Like the pasuk says, Vayasimu osso al nes - a flagpole - a high position.
The possuk states "Vayaazov ess bigdo beyadah - VAYANOS!! = & he became RAISED HIGH!!!