Moved shared code out of Common.UnitTests