Exemple #1
0
        public void BlackList()
        {
            var items = Blacklist.GetBlacklistItems(PackageBlacklistFilePath);

            var expected = new[]
            {
                new BlacklistItem()
                {
                    Name  = "Xamarin.Forms",
                    Range = VersionRange.All
                },
                new BlacklistItem()
                {
                    Name  = "Newtonsoft.Json",
                    Range = VersionRange.Parse("[7.0.0,9.0.0]")
                },
                new BlacklistItem()
                {
                    Name  = "Google.Protobuf",
                    Range = VersionRange.Parse("[3.10.0]")
                },
                new BlacklistItem()
                {
                    Name  = "Portable.BouncyCastle",
                    Range = VersionRange.All
                },
            }.OrderBy(i => i.Name);

            Assert.IsTrue(items.SequenceEqual(expected));
        }
Exemple #2
0
        public void SimpleBlackList()
        {
            var items = Blacklist.GetBlacklistItems(SimpleBlacklistFilePath);

            Assert.IsTrue(items.Count == 1);

            var item = items.First();

            Assert.IsTrue(item.Name == "Xamarin.Forms");
            Assert.IsTrue(item.Range == VersionRange.All);
        }
Exemple #3
0
        public void CommentsBlackList()
        {
            var items = Blacklist.GetBlacklistItems(CommentsBlacklistFilePath);

            Assert.IsTrue(items.Count == 2);

            var i1 = items.First(i => i.Name == "Xamarin.Forms");
            var i2 = items.First(i => i.Name == "iTextSharp");

            Assert.IsTrue(i1.Range == VersionRange.All);
            Assert.IsTrue(i2.Range == VersionRange.All);
        }
Exemple #4
0
        public void EmptyBlackList()
        {
            var items = Blacklist.GetBlacklistItems(EmptyBlacklistFilePath);

            Assert.IsTrue(!items.Any());
        }
Exemple #5
0
 public void FileDoesNotExist()
 {
     Assert.ThrowsException <FileNotFoundException>(() => Blacklist.GetBlacklistItems("FAIL"));
 }