Example #1
0
        public void MultipleTargetFramworks()
        {
            LockFile lockFile = GetLockFileWithMultipleTargetFrameworks();

            ProjectRootElement project = ValidateProject(lockFile);

            project.ItemGroups.Count.ShouldBe(lockFile.PackageSpec.TargetFrameworks.Count);

            foreach (LockFileTarget target in lockFile.Targets)
            {
                ProjectItemGroupElement itemGroupElement = project.ItemGroups.SingleOrDefault(i => i.Condition.Equals($" '$(TargetFramework)' == '{target.TargetFramework.GetShortFolderName()}' "));

                itemGroupElement.ShouldNotBeNull();

                itemGroupElement.Items.Count.ShouldBe(target.Libraries.Count);
            }
        }