コード例 #1
0
        public void AssetTargetFallbackUtility_HasInvalidFallbackCombinationVerifyFalseForMultipleFrameworks()
        {
            var tfis = new List <TargetFrameworkInformation>
            {
                new TargetFrameworkInformation()
                {
                    FrameworkName = NuGetFramework.Parse("netcoreapp2.0")
                },
                new TargetFrameworkInformation()
                {
                    FrameworkName = NuGetFramework.Parse("netcoreapp1.0")
                },
                new TargetFrameworkInformation()
                {
                    FrameworkName = NuGetFramework.Parse("netcoreapp1.1")
                }
            };

            // Add PTF to one framework, and ATF to another
            tfis[0].Imports.Add(NuGetFramework.Parse("net461"));
            tfis[1].AssetTargetFallback.Add(NuGetFramework.Parse("net461"));

            var project = new PackageSpec(tfis);

            AssetTargetFallbackUtility.HasInvalidFallbackCombination(project).Should().BeFalse();
        }
コード例 #2
0
        public void AssetTargetFallbackUtility_HasInvalidFallbackCombinationVerifyFalseWithATFOnly()
        {
            var tfis = new List <TargetFrameworkInformation>
            {
                new TargetFrameworkInformation()
                {
                    FrameworkName = NuGetFramework.Parse("netcoreapp2.0")
                }
            };

            tfis[0].AssetTargetFallback.Add(NuGetFramework.Parse("net461"));

            var project = new PackageSpec(tfis);

            AssetTargetFallbackUtility.HasInvalidFallbackCombination(project).Should().BeFalse();
        }