Beispiel #1
0
        public void ShouldNotDownloadTheSameEpisodeTwiceDuringSameFilter()
        {
            Feed = new Feed
            {
                Id      = 1,
                Filters = new List <Filter>
                {
                    new Filter
                    {
                        Id            = 1,
                        FeedId        = 1,
                        Disabled      = false,
                        TitleMatch    = "Planet.Earth 2",
                        Include       = "",
                        Exclude       = "",
                        Episode       = 2,
                        OnlyMatchOnce = true,
                        Downloads     = new List <Download> {
                        },
                    }
                },
                Torrents = new List <Torrent>
                {
                    new Torrent
                    {
                        Name = "Planet Earth 2 E02 1080p WEB-DEL H.264",
                        GUID = "1"
                    },
                    new Torrent
                    {
                        Name = "Planet Earth 2 E02 1080p WEB-DEL H.264",
                        GUID = "2"
                    },
                    new Torrent
                    {
                        Name = "Planet Earth 2 E02 1080p HDTV x64",
                        GUID = "3"
                    },
                    new Torrent
                    {
                        Name = "Planet Earth 2 E02 720p HDTV x64",
                        GUID = "4"
                    }
                }
            };

            Result = FeedFilterer.FindMatchingTorrents(Feed).ToList();

            Assert.AreEqual(1, Result.Count);
            Assert.IsTrue(Result.Any(x => x.GUID == "1"));
        }
Beispiel #2
0
        public void ShouldBeAbleToDownloadEverythingInFeed()
        {
            Feed = new Feed
            {
                Id      = 1,
                Filters = new List <Filter>
                {
                    new Filter
                    {
                        Id            = 1,
                        FeedId        = 1,
                        Disabled      = false,
                        TitleMatch    = "*",
                        Include       = "",
                        Exclude       = "",
                        OnlyMatchOnce = false,
                        Downloads     = new List <Download> {
                        },
                    }
                },
                Torrents = new List <Torrent>
                {
                    new Torrent
                    {
                        Name = "Planet Earth 2 E02 1080p WEB-DEL H.264",
                        GUID = "1"
                    },
                    new Torrent
                    {
                        Name = "Planet Earth 2 E02 1080p WEB-DEL H.264",
                        GUID = "2"
                    },
                    new Torrent
                    {
                        Name = "Planet Earth 2 E02 1080p HDTV x64",
                        GUID = "3"
                    },
                    new Torrent
                    {
                        Name = "Planet Earth 2 E02 720p HDTV x64",
                        GUID = "4"
                    }
                }
            };

            Result = FeedFilterer.FindMatchingTorrents(Feed).ToList();

            Assert.AreEqual(4, Result.Count);
        }
Beispiel #3
0
        public void ShouldDownloadCorrectItems()
        {
            Feed = new Feed
            {
                Id      = 1,
                Filters = new List <Filter>
                {
                    new Filter
                    {
                        Id            = 1,
                        FeedId        = 1,
                        Disabled      = false,
                        TitleMatch    = "The.Whole.Truth",
                        Include       = "1080p",
                        Exclude       = "720p;Remux;AVC;H.264",
                        OnlyMatchOnce = false,
                        Downloads     = new List <Download>
                        {
                            new Download
                            {
                                Id   = 1,
                                Name = "The Whole Truth 1080p BluRay x264",
                                GUID = "1"
                            }
                        },
                    }
                },
                Torrents = new List <Torrent>
                {
                    new Torrent
                    {
                        Name = "The Whole Truth 1080p BluRay x264",
                        GUID = "1"
                    },
                    new Torrent
                    {
                        Name = "The Whole Truth 720 BluRay DTS x264",
                        GUID = "2"
                    },
                    new Torrent
                    {
                        Name = "The Whole Truth 1080p Remux AVC FLAC",
                        GUID = "3"
                    },
                    new Torrent
                    {
                        Name = "The Whole Truth 1080p WEB-DL H.264",
                        GUID = "4"
                    },
                    new Torrent
                    {
                        Name = "The Whole Truth 1080p NOR Blu-ray AVC DTS-HD",
                        GUID = "5"
                    },
                    new Torrent
                    {
                        Name = "The Whole Truth 1080p BluRay x264 INTERNAL",
                        GUID = "6"
                    },
                }
            };

            Result = FeedFilterer.FindMatchingTorrents(Feed).ToList();

            Assert.AreEqual(1, Result.Count);
            Assert.IsTrue(Result.Any(x => x.GUID == "6"));
        }