They’re not being tested to prevent them getting the virus, they’re testing them to make sure they don’t have it already in order to pass it on.
Flu is a very different issue. Covid-19 is new and more deadly that the flu which just goes to show how many people could have died if we didn’t have such mesures in place.