public void CompatibilityTable_Basic()
        {
            var net45 = NuGetFramework.Parse("net45");
            var net40 = NuGetFramework.Parse("net40");
            var net35 = NuGetFramework.Parse("net35");
            var wp8   = NuGetFramework.Parse("wp8");

            var all = new NuGetFramework[] { net35, net40, net45, wp8 };

            CompatibilityTable table = new CompatibilityTable(all);

            IEnumerable <NuGetFramework> compatible = null;

            table.TryGetCompatible(wp8, out compatible);

            Assert.Equal(wp8, compatible.Single());
        }
        public void CompatibilityTable_Basic2()
        {
            var net45 = NuGetFramework.Parse("net45");
            var net40 = NuGetFramework.Parse("net40");
            var net35 = NuGetFramework.Parse("net35");
            var wp8   = NuGetFramework.Parse("wp8");

            var all = new NuGetFramework[] { net35, net40, net45, wp8 };

            CompatibilityTable table = new CompatibilityTable(all);

            IEnumerable <NuGetFramework> compatible = null;

            table.TryGetCompatible(net40, out compatible);

            Assert.Equal(2, compatible.Count());
            Assert.Equal(net35, compatible.First());
            Assert.Equal(net40, compatible.Skip(1).First());
        }
        public void CompatibilityTable_PCL()
        {
            var fw1   = NuGetFramework.Parse("portable-net45+win8");
            var fw2   = NuGetFramework.Parse("portable-net45+win8+wp8");
            var win81 = NuGetFramework.Parse("win81");

            var all = new NuGetFramework[] { win81, fw1, fw2 };

            CompatibilityTable table = new CompatibilityTable(all);

            IEnumerable <NuGetFramework> compatible = null;

            table.TryGetCompatible(win81, out compatible);

            var results = compatible.ToArray();

            Assert.Equal(3, results.Count());
            Assert.Equal(win81, results[0]);
            Assert.Equal(fw1, results[1]);
            Assert.Equal(fw2, results[2]);
        }
        public void CompatibilityTable_Alias()
        {
            var win7      = NuGetFramework.Parse("win7");
            var netcore45 = NuGetFramework.Parse("netcore45");
            var win81     = NuGetFramework.Parse("win81");
            var win9      = NuGetFramework.Parse("win9");

            var all = new NuGetFramework[] { win7, win81, win9, netcore45 };

            CompatibilityTable table = new CompatibilityTable(all);

            IEnumerable <NuGetFramework> compatible = null;

            table.TryGetCompatible(win9, out compatible);

            var results = compatible.ToArray();

            Assert.Equal(4, results.Count());
            Assert.Equal(win7, results[0]);
            Assert.Equal(win81, results[1]);
            Assert.Equal(win9, results[2]);
            Assert.Equal(netcore45, results[3]);
        }