Beispiel #1
0
        public void ItComputesPrivateAssetsExclusionList()
        {
            LockFile       lockFile       = TestLockFiles.GetLockFile("dependencies.withgraphs");
            ProjectContext projectContext = lockFile.CreateProjectContext(
                FrameworkConstants.CommonFrameworks.NetStandard16,
                null,
                Constants.DefaultPlatformLibrary,
                isSelfContained: false);

            IEnumerable <string> privateAssetPackageIds = new[] { "Microsoft.Extensions.Logging.Abstractions" };
            IDictionary <string, LockFileTargetLibrary> libraryLookup =
                projectContext
                .LockFileTarget
                .Libraries
                .ToDictionary(e => e.Name, StringComparer.OrdinalIgnoreCase);

            HashSet <string> exclusionList =
                projectContext.GetPrivateAssetsExclusionList(privateAssetPackageIds, libraryLookup);

            HashSet <string> expectedExclusions = new HashSet <string>()
            {
                "Microsoft.Extensions.Logging.Abstractions",
                "System.Collections.Concurrent",
                "System.Diagnostics.Tracing",
            };

            exclusionList.Should().BeEquivalentTo(expectedExclusions);
        }