示例#1
0
        public void ServiceCanFindIssuesInPath()
        {
            var           eComicService = new EComicService();
            List <string> filenames     = eComicService.GetIssueNamesInPath(TestPath, false);

            Assert.IsTrue(filenames.Exists(ContainsBlueBeetle003));
        }
示例#2
0
        public void ServiceCanFindIssuesInPathAndReturnIssues()
        {
            var          eComicService = new EComicService();
            List <Issue> issues        = eComicService.GetIssuesInPath(TestPath, true);

            Assert.IsTrue(issues.Count == 6);
            Assert.IsTrue(issues[0].id == 9383);
            Assert.IsTrue(issues[5].id == 226638);
        }
示例#3
0
        public void ServiceCanReturnIssue()
        {
            EComicService eComicService = new EComicService();
            Issue         issue         = eComicService.GetComicInfoFromEComic(TestCBZComicFileName);

            Assert.IsTrue(issue.id == 9383);
            Assert.IsTrue(issue.name == "Bugs the Squids");
            Assert.IsTrue(issue.summary.StartsWith("The Squid Gang crash the party"));
            Assert.IsTrue(issue.issueNumber == 1);
            Assert.IsTrue(issue.publishMonth == 6);
            Assert.IsTrue(issue.publishYear == 1967);
        }
        private bool CollectMissingIssues()
        {
            IEComicService eComicService = new EComicService();
            List <Issue>   issues        = eComicService.GetIssuesInPath(Path, true);
            int            count         = 0;

            foreach (Issue issue in issues)
            {
                count++;
                if (repository.UpdateIssueToCollected(issue.id))
                {
                    PrintMessage("Updating Issue " + count + " of " + issues.Count() + " - " + issue.name + "...");
                }
                else
                {
                    PrintMessage("Issue does not exist: " + issue.name + " issue: " + issue.issueNumber + " id: " + issue.id);
                }
                NotifyPropertyChanged("Messages", 0);
            }
            PrintMessage("Updating Issues Complete.");
            NotifyPropertyChanged("Messages", 0);
            return(true);
        }