The best way to test for gold or silver is to use a chemical or melting refining method, I don't know enough about gold yet but I'm sure there's a proper method for refining it and making sure you actually have gold. The thing you have to be careful about with coins at least is that in history states used to mix copper with the gold in order to make more coins. I don't know about magnets, but I know about a chemical solution you can at least use on Silver to refine it into fine silver, you should also note though that some Gold and Silver pieces will have different levels of purity on purposes so they can be shaped easily but if you bought the silver for investment purposes that shouldn't be the case.
Here's the chemical solution for silver, it involves, copper, water and nitric acid, BE WARNED chemical refining can get nasty so make sure you have a proper mask and don't breathe the stuff in, I found a tutorial ages ago about silver refining and I suppose now I should maybe have a look at gold refining too, after re-reading this it seems the chemical reaction might work on gold too, it might be worth trying with just a coin or something to see how much gold you genuinely have.
http://www.abovetopsecret.com/forum/thread810904/pg1Just so you know, this melts down any crap and will likely ruin the shape of your bars or coins, so only do this if you absolutely want to make sure this is pure, I don't know about how to use heat to refine gold/silver but this method looks like it works just fine as well, I might do some more research on refining but I have other projects I need to focus on right now.