示例#1
0
        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");
        }
示例#2
0
        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");
        }
示例#3
0
        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");
        }
示例#4
0
        public void GivenNoToolPathItCanTellNoCorrectionNeeded()
        {
            var existingPath = @"C:\Users\myname\AppData\Local\Microsoft\WindowsApps;C:\Users\myname\other";

            DotDefaultPathCorrector.NeedCorrection(existingPath, out string _).Should().BeFalse();
        }
示例#5
0
        public void GivenEmptyItCanTellNoCorrectionNeeded()
        {
            var existingPath = "";

            DotDefaultPathCorrector.NeedCorrection(existingPath, out string _).Should().BeFalse();
        }