Can you get a dna test done while pregnant?

Can you get a dna test while pregnant? and how much is it?