public void WindowsProperReturn() { bool isWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows); if (!isWindows) { Assert.Ignore("Skipping on a non-Windows operating system"); } List <string> winReturn = ReturnIp.WindowsReturn(ParseIp.WindowsParse(windowsOutput)); Regex testIp = new(@"\d+\.\d+\.\d+\.\d+"); foreach (var item in winReturn) { Assert.IsTrue(testIp.IsMatch(item)); } Assert.AreEqual(3, winReturn.Count); }
public void LinuxProperReturn() { bool isLinux = RuntimeInformation.IsOSPlatform(OSPlatform.Linux); if (!isLinux) { Assert.Ignore("Skipping on a non-Linux operating system"); } List <string> linReturn = ReturnIp.LinuxReturn(ParseIp.LinuxParse(linuxOutput)); Regex testIp = new(@"\d+\.\d+\.\d+\.\d+"); foreach (var item in linReturn) { Assert.IsTrue(testIp.IsMatch(item)); } Assert.AreEqual(4, linReturn.Count); }