Are you trying to connect to the official Nintendo servers? They turned them off for DS and Wii consoles in 2014. The only way to play over wi-fi is to use AltWFC or Wiimmfi.
Quick instruction of using AltWFC in first post ->
https://gbatemp.net/threads/every-day-online-play.423984/
If you already know this, and you have problem with "unofficial" servers, just set everything manually (DNS, access point name) and don't use connection test.