diff --git a/source/Kangaroo/Queries/NetworkQuerierFactory.cs b/source/Kangaroo/Queries/NetworkQuerierFactory.cs index cac4764..283a981 100644 --- a/source/Kangaroo/Queries/NetworkQuerierFactory.cs +++ b/source/Kangaroo/Queries/NetworkQuerierFactory.cs @@ -20,22 +20,33 @@ public NetworkQuerierFactory(ILogger logger, IQueryPingResults ping, Func public IQueryNetworkNode CreateQuerier() { - return RuntimeInformation.IsOSPlatform(OSPlatform.Linux) - ? new QueryNetworkNode( - logger: _logger, - ping: _ping, - mac: new LinuxQueryMacAddress(_logger), - host: new QueryHostname(_logger), - http: _clientFactory != null - ? new QueryWebServer(_logger, _clientFactory) - : null) - : new QueryNetworkNode( - logger: _logger, - ping: _ping, - mac: new WindowsQueryMacAddress(_logger), - host: new QueryHostname(_logger), - http: _clientFactory != null - ? new QueryWebServer(_logger, _clientFactory) - : null); + + // Linux || Mac + if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux) || RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) + { + return new QueryNetworkNode( + logger: _logger, + ping: _ping, + mac: new LinuxQueryMacAddress(_logger), + host: new QueryHostname(_logger), + http: _clientFactory != null + ? new QueryWebServer(_logger, _clientFactory) + : null); + } + + // Windows + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + { + return new QueryNetworkNode( + logger: _logger, + ping: _ping, + mac: new WindowsQueryMacAddress(_logger), + host: new QueryHostname(_logger), + http: _clientFactory != null + ? new QueryWebServer(_logger, _clientFactory) + : null); + } + + throw new PlatformNotSupportedException(); } } \ No newline at end of file