public void Given2InstallationItCanCorrectDotDefaultPath() { var existingPath = @"C:\Users\user1\AppData\Local\Microsoft\WindowsApps;C:\Users\user2\AppData\otherapp;C:\Users\user1\.dotnet\tools;C:\Users\user2\.dotnet\tools"; DotDefaultPathCorrector.NeedCorrection(existingPath, out string correctPath).Should().BeTrue(); correctPath.Should().Be(@"%USERPROFILE%\AppData\Local\Microsoft\WindowsApps;%USERPROFILE%\AppData\otherapp"); }
public void ItCanCorrectDotDefaultPath() { var existingPath = @"C:\Users\myname\AppData\Local\Microsoft\WindowsApps;C:\Users\myname\.dotnet\tools"; DotDefaultPathCorrector.NeedCorrection(existingPath, out string correctPath).Should().BeTrue(); correctPath.Should().Be(@"%USERPROFILE%\AppData\Local\Microsoft\WindowsApps"); }
public void GivenSubsequencePathWithExtraFormatItCanCorrectDotDefaultPath() { var existingPath = @";C:\Users\myname\AppData\Local\Microsoft\WindowsApps;C:\Users\myname\.dotnet\tools;C:\Users\myname\other;;"; DotDefaultPathCorrector.NeedCorrection(existingPath, out string correctPath).Should().BeTrue(); correctPath.Should().Be(@"%USERPROFILE%\AppData\Local\Microsoft\WindowsApps;%USERPROFILE%\other"); }
public void GivenNoToolPathItCanTellNoCorrectionNeeded() { var existingPath = @"C:\Users\myname\AppData\Local\Microsoft\WindowsApps;C:\Users\myname\other"; DotDefaultPathCorrector.NeedCorrection(existingPath, out string _).Should().BeFalse(); }
public void GivenEmptyItCanTellNoCorrectionNeeded() { var existingPath = ""; DotDefaultPathCorrector.NeedCorrection(existingPath, out string _).Should().BeFalse(); }