public LookupOriginalImplementation ( ImplementationSelection implemenationSelection ) : Implementation | ||
implemenationSelection | ImplementationSelection | |
return | Implementation |
private bool TryToUseExistingCandidate([NotNull] Requirements requirements, [NotNull, ItemNotNull] IEnumerable <SelectionCandidate> suitableCandidates, [NotNull] ImplementationSelection selection) { if (!suitableCandidates.Contains(selection)) { return(false); } if (selection.ContainsCommand(requirements.Command)) { return(true); } var command = selection.AddCommand(requirements, from: _candidateProvider.LookupOriginalImplementation(selection)); return(TryToSolveCommand(command, requirements)); }
public void TestLookupOriginalImplementation() { var mainFeed = FeedTest.CreateTestFeed(); mainFeed.Feeds.Clear(); _feedManagerMock.Setup(x => x[FeedTest.Test1Uri]).Returns(mainFeed); _packageManagerMock.Setup(x => x.Query((PackageImplementation)mainFeed.Elements[1])).Returns(Enumerable.Empty <ExternalImplementation>()); var requirements = new Requirements(FeedTest.Test1Uri, Command.NameRun); var candidates = _provider.GetSortedCandidates(requirements); var candidate = candidates.Single().ToSelection(requirements, allCandidates: candidates); _provider.LookupOriginalImplementation(candidate) .Should().Be(mainFeed.Elements[0]); }