public void WhenCallWithNoSlnOrProjectArgumentItCollectProjectsFromSolution()
        {
            var projectDirectory = _testAssetsManager
                                   .CopyTestAsset("TestAppWithSlnAndCsprojFiles")
                                   .WithSource()
                                   .Path;

            var result = WorkloadRestoreCommand.DiscoverAllProjects(projectDirectory);

            result.Should().Contain(f => Path.GetFileName(f) == "App.csproj");
        }
        public void WhenCallWithDirectoryWith2ProjectItShouldFindAll()
        {
            var projectDirectory = _testAssetsManager
                                   .CopyTestAsset("TestAppWithSlnAndCsprojFiles")
                                   .WithSource()
                                   .Path;

            var result =
                WorkloadRestoreCommand.DiscoverAllProjects(Path.Combine(projectDirectory, "Multiple"));

            result.Should().Contain(f => Path.GetFileName(f) == "First.csproj");
            result.Should().Contain(f => Path.GetFileName(f) == "Second.csproj");
        }
        public void WhenCallWithSlnOrProjectArgumentItCollectProjectsFromSolution()
        {
            var projectDirectory = _testAssetsManager
                                   .CopyTestAsset("TestAppWithSlnAndCsprojFiles")
                                   .WithSource()
                                   .Path;

            var result =
                WorkloadRestoreCommand.DiscoverAllProjects("",
                                                           new[]
            {
                Path.Combine(projectDirectory, "App.sln"),
                Path.Combine(projectDirectory, "Lib", "Lib.csproj")
            });

            // current directory is ignored
            result.Should().Contain(f => Path.GetFileName(f) == "App.csproj", "from checking the sln file");
            result.Should().Contain(f => Path.GetFileName(f) == "Lib.csproj", "from directly pass in");
        }