Esempio n. 1
0
 public void Simple()
 {
     Environment.SetEnvironmentVariable("PackageUpdateIgnores", "ignore, otherIgnore");
     Assert.True(Excluder.ShouldExclude("SolutionToIgnore.sln"));
     Assert.True(Excluder.ShouldExclude("SolutionOtherIgnore.sln"));
     Assert.False(Excluder.ShouldExclude("Solution.sln"));
 }
Esempio n. 2
0
    static async Task ProcessSolution(string solution, string?package)
    {
        if (Excluder.ShouldExclude(solution))
        {
            Console.WriteLine($"  Exclude: {solution}");
            return;
        }

        Console.WriteLine($"  {solution}");
        await SolutionRestore.Run(solution);

        var solutionDirectory = Directory.GetParent(solution) !.FullName;

        foreach (var project in FileSystem.EnumerateFiles(solutionDirectory, "*.csproj"))
        {
            Console.WriteLine($"    {project.Replace(solutionDirectory, "").Trim(Path.DirectorySeparatorChar)}");
            foreach (var pending in await PendingUpdateReader.ReadPendingUpdates(project))
            {
                if (package == null)
                {
                    await Update(project, pending.Package, pending.Latest);

                    continue;
                }

                if (string.Equals(package, pending.Package, StringComparison.OrdinalIgnoreCase))
                {
                    await Update(project, pending.Package, pending.Latest);
                }
            }
        }
    }
Esempio n. 3
0
 protected override void Arrange()
 {
     base.Arrange();
     base.Act();
     FileReader.Stub(x => x.Read(Path)).Return(FilesRead);
     FileInformation1.Stub(x => x.Extension).Return(".dtsx");
     FileInformation2.Stub(x => x.Extension).Return(".ddddd");
     FileInformation3.Stub(x => x.Extension).Return(".txt");
     AcceptedExtensions.Stub(x => x.Get(FileInformation1.Extension)).Return(FileInformation1.Extension);
     AcceptedExtensions.Stub(x => x.Get(FileInformation2.Extension)).Return(null);
     AcceptedExtensions.Stub(x => x.Get(FileInformation3.Extension)).Return(FileInformation3.Extension);
     Excluder.Stub(x => x.Exclude(FilesRead, AcceptedPrefix)).Return(Expected);
 }