You can use something like this:
$pp = $ProgressPreference
$ProgressPreference = 'SilentlyContinue'
test-netconnection -ComputerName 8.8.8.8 -InformationLevel Quiet
$ProgressPreference = $pp
But why the need for a 1 or 0 as the result? The Test-NetConnection will return either $True or $False (if the -InformationLevel parameter is set to "Quiet") which is easier to understand.
The annoying thing with this cmdlet is the "progress" information sent to the console. You have to manipulate the $ProgressPreference variable to suppress that.
If you use the Net-Connection frequently in a script you'd do well to create a function so you don't have to repeatedly set and reset the $ProgressPreference variable.