public void TestGetUncachedSelections()
        {
            var selections = SelectionsTest.CreateTestSelections();

            _storeMock.Setup(x => x.Contains(selections.Implementations[0].ManifestDigest)).Returns(false);
            _storeMock.Setup(x => x.Contains(selections.Implementations[1].ManifestDigest)).Returns(true);

            var implementationSelections = _selectionsManager.GetUncachedSelections(selections);

            implementationSelections.Should().BeEquivalentTo(new[] { selections.Implementations[0] }, because: "Only the first implementation should be listed as uncached");
        }
Beispiel #2
0
        /// <summary>
        /// Combines <see cref="ISelectionsManager.GetUncachedSelections"/> and <see cref="ISelectionsManager.GetImplementations"/>.
        /// </summary>
        /// <param name="selectionsManager">The <see cref="ISelectionsManager"/></param>
        /// <param name="selections">The selections to search for <see cref="ImplementationSelection"/>s that are missing.</param>
        public static ICollection <Implementation> GetUncachedImplementations([NotNull] this ISelectionsManager selectionsManager, [NotNull] Selections selections)
        {
            #region Sanity checks
            if (selectionsManager == null)
            {
                throw new ArgumentNullException(nameof(selectionsManager));
            }
            if (selections == null)
            {
                throw new ArgumentNullException(nameof(selections));
            }
            #endregion

            return(selectionsManager.GetImplementations(selectionsManager.GetUncachedSelections(selections)).ToList());
        }