Educational Testing Service has sold a 310,000-square-foot office and industrial building in Ewing for nearly $19 million, brokers with CBRE announced Tuesday.