Make sure that referenced assemblies are present before testing

Fix #640.