LookupOriginalImplementation() публичный Метод

Retrieves the original Implementation an ImplementationSelection was based ofF.
public LookupOriginalImplementation ( ImplementationSelection implemenationSelection ) : Implementation
implemenationSelection ImplementationSelection
Результат Implementation
Пример #1
0
            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));
            }
Пример #2
0
        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]);
        }