public void WslUtils_ConvertToDistroPath(string path, string expectedDistro, string expectedPath)
        {
            string actualPath = WslUtils.ConvertToDistroPath(path, out string actualDistro);

            Assert.Equal(expectedPath, actualPath);
            Assert.Equal(expectedDistro, actualDistro);
        }
        public override Process CreateProcess(string path, string args, bool useShellExecute, string workingDirectory)
        {
            // If we're asked to start a WSL executable we must launch via the wsl.exe command tool
            if (!useShellExecute && WslUtils.IsWslPath(path))
            {
                string wslPath = WslUtils.ConvertToDistroPath(path, out string distro);
                return(WslUtils.CreateWslProcess(distro, $"{wslPath} {args}", workingDirectory));
            }

            return(base.CreateProcess(path, args, useShellExecute, workingDirectory));
        }
 public void WslUtils_ConvertToDistroPath_Invalid_ThrowsException(string path)
 {
     Assert.Throws <ArgumentException>(() => WslUtils.ConvertToDistroPath(path, out _));
 }