I've had this problem with the 45W power adapter that came with my macbook air 2012. I've had this happened to me on a few occasions with the iPhone charger as well.
The charger suddenly stopped charging about two months after warranty was expired. I didn't want to spend $80 on a charger but couldn't find any solutions over the internet.
Here is something that works for me and you can try.
If you try to charge but it doesn't charge or light up, you can unplug the charger from the outlet (you don't need to unplug it from your computer) and literally sit on the charger for a couple of minutes and then try charging again.
This method has kept me from buying a new charger for over two years since it "broke'! works 100% of the time for me when it refuses to charge.
So, if you think your charger is broken, give this tip a try. You'll save some $$$